[Lazarus] Hi-DPI tweak of components

Ondrej Pokorny lazarus at kluug.net
Thu Jun 8 19:38:12 CEST 2023


On 08.06.2023 19:30, Giuliano Colla wrote:
> Il 08/06/23 18:40, Ondrej Pokorny via lazarus ha scritto:
>
>> And because it is so much fun, I wrote a completely general program 
>> to test it.
>
> Well you've shown that it isn't so bad. But there's another detail to 
> consider, when resizing: font size. Font size can (and should be) 
> specified in typographic points, in order to ensure that text is both 
> readable and not too large. i.e. in units which are 1/72". Resizing 
> when text size is specified in inches, i.e. in its actual, system 
> independent, size, while width and height are specified in pixels i.e. 
> in system dependent units is the best way to create the mess which is 
> there since the early times of Delphi.

Font size/height are not scaled. The TFont.PixelsPerInch property is 
directly assigned to the target value, so there cannot be a scaling 
problem there.

See TControl.ScaleFontsPPI and TControl.DoScaleFontPPI.

Ondrej



More information about the lazarus mailing list