Sign in Join
FPDoc Onlineexperiment

TCustomGrid.FixDesignFontsPPI procedure

Member of TCustomGridpublicIn unit Grids

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

Declaration

pascal
procedure 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

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.