[Overview][Types][Classes][Index] | Reference for unit 'LazCanvas' (#lcl)

# TLazCanvas.AssignFontData

Sets the Font data for the canvas.

## Declaration

Source position: lazcanvas.pas line 149

`public procedure TLazCanvas.AssignFontData(`
`AFont: TFPCustomFont`
`);`

## Arguments

`AFont` |  | TFPCustomFont instance with the attributes assigned to the Font for the canvas.

## Description

AssignFontData copies property values in AFont to the Font for class instance, including:

- FPColor
- Name
- Size
- Bold
- Italic
- Underline
- Strikethrough

No actions are performed in the method if AFont has not been assigned (contains Nil.

Utilized by LCLIntf.SelectObject and by the RestoreState method. This is needed because calling Assign for the Pen, Brush, or Font properties raises exceptions.