Unit 'Controls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

TControl.ScaleFontsPPI

Resizes a font to the specified Pixels per Inch setting.

Declaration

Source position: controls.pp line 1627

public procedure TControl.ScaleFontsPPI(

  const AToPPI: Integer;

  const AProportion: Double

); virtual;

Arguments

AToPPI

  

PPI setting to apply to the font.

AProportion

  

Scaling factor applied to the font height.

Description

ScaleFontsPPI is a method used to resize a font in the control to the specified display density (Pixels per Inch) using the scaling factor in AProportion (when needed).

A font may need to be scaled when the run-time PPI setting for the screen differs from the design-time value applied to the font. If the font height is not assigned at run-time, its height is set to the value in TFont.PixelsPerInch / Screen.PixelsPerInch.

When AToPPI has a positive non-zero value, it is stored in the TFont.PixelsPerInch property for the font. Otherwise, the existing TFont.PixelsPerInch value is adjusted using the scaling factor in AProportion.

ScaleFontsPPI may be overridden in descendent controls to call the method for its child controls.

ScaleFontsPPI is called form the AutoAdjustLayout method.

See also

TControl.AutoAdjustLayout

  

Applies an automatic adjustment layout policy to the control.

TControl.ShouldAutoAdjust

  

Indicates whether the height and/or width for a control can be automatically adjusted.



CT Web help

CodeTyphon Studio