Vcl.Graphics.TCanvas.Font

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Font: TFont read FFont write SetFont;

C++

__property TFont* Font = {read=FFont, write=SetFont};

Properties

Type Visibility Source Unit Parent
property published
Vcl.Graphics.pas
Vcl.Graphics.hpp
Vcl.Graphics TCanvas

Description

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

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.

See Also

Code Examples