RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCanvas.Font Property

Specifies the font to use when writing text on the image.

Pascal
property Font: TFont;
C++
__property TFont Font;

Set Font to specify the font to use for writing text on the image. The value of Font is a T Font object. Set the properties of the T Font object to specify the font face, color, size, style, and any other aspects of the font. 

The Canvas.Font property is only guaranteed to equal the Font property if you have an owner-drawn listbox (where you are expected to use the canvas). Even in that case, it is only guaranteed to equal the Font property once the first paint message is underway. If you use a canvas inside an ownerdraw event, everything should work as expected. Using the canvas for a reason outside the scope of its intended usage may give unpredictable results.

Note: Setting the Font property assigns the specified T Font object, rather than replacing the current T Font object.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!