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

# TCustomGrid.SetCanvasFont

Sets the Canvas font to the specified value.

## Declaration

Source position: grids.pas line 1185

`protected procedure TCustomGrid.SetCanvasFont(`
`aFont: TFont`
`);`

## Arguments

`aFont` |  | Font applied to the canvas for the grid.

## Description

SetCanvasFont is used to assign the TFont instance in AFont to the Canvas for the grid control.

Different fonts can be used to render the title in fixed headers and the data in the cells. The font used is determined (and assigned) when the PrepareCanvas method configures the Canvas to draw cells in the grid. SetCanvasFont ensures that the new font is stored in an internal member when the font is assigned to the Canvas.