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

TCustomGrid.FixDesignFontsPPI

Adjusts fonts in the control to the specified design-time PixelsPerInch.

Declaration

Source position: grids.pas line 1354

public procedure TCustomGrid.FixDesignFontsPPI(

  const ADesignTimePPI: Integer

); override;

Description

FixDesignFontsPPI is an overridden procedure used to adjust the assigned font size for grid columns and their titles to the specified design-time Pixels Per Inch (PPI). This is needed because the display density (PPI) used for fonts is not stored in Form resource (.LFM) files. When the design-time PPI is different than the run-time setting, font scaling issues can occur.

FixDesignFontsPPI restores the design-time font PPI so it can be used in the LCL Scaling mechanism. FixDesignFontsPPI calls the inherited method on entry, and sets the value for the PixelsPerInch property in TitleFont when needed. Column definitions stored in the Columns property are also adjusted (when needed) by calling the FixDesignFontsPPI method for each of the TGridColumn instances in the container.

FixDesignFontsPPI is called when scaling is enabled, and the Form which hosts the control calls its Loaded method during LCL streaming.

See also

TCustomGrid.ScaleFontsPPI

  

Resizes fonts using a target PPI and a scaling factor.

TStringGrid.Columns

  

Definitions for the columns displayed the grid.

TGridColumns

  

Collection used to store column definitions for a grid control.

TGridColumn.FixDesignFontsPPI

  

Corrects the design-time PPI for the column title.

TControl.FixDesignFontsPPI


Version 4.0 Generated 2025-05-03 Home