[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Graphics' (#lcl)

# TCanvas.Font

Contains the Font used to render text on the drawing surface.

## Declaration

Source position: graphics.pp line 1177

`published property TCanvas.Font : TFont read FLazFont write SetLazFont;`

## Description

Font is a TFont property which contains the font used to render text on the drawing surface. Values in Font determine the formatting / layout applied in methods that render text, like TextOut and TextRect. Setting a new value in Font calls the Assign method in the class instance to store the new values. Property values in Font can also be modified directly to use the desired values.

The values assigned in Font are used in methods that calculate the size for text like TextExtent, TextHeight, TextWidth, and TextFitInfo.

## See also

TFont |  | Represents a font used to draw text in an application.
TCanvas.TextOut |  | Writes text at the specified position on the canvas.
TCanvas.TextRect |  | Draws text on the canvas at the specified location using the given style.
TCanvas.TextExtent |  | Calculates the width and height for the specified Text using the Font for the canvas.
TCanvas.TextHeight |  | Gets the height for the specified text using the canvas Font.
TCanvas.TextWidth |  | Gets the width for the specified text using the canvas Font.
TCanvas.TextFitInfo |  | Gets the number of characters that fit in the specified maximum width.