[Lazarus] Font sizes on various platforms
joshyfun at gmail.com
Wed Jul 8 11:32:15 CEST 2009
Wednesday, July 8, 2009, 8:24:17 AM, you wrote:
HPD> The dpi and default font size should be considered together, because
HPD> they make standard text appear to the user in *his* preferred size.
HPD> While every platform has a different opinion about *how* the user should
HPD> specify his preferences, the resulting default font size in pixels
HPD> should be understood as a *user* specific constant.
That's the reason I wrote ScaleBy to not force the user to use "my"
font choose and always try to use his/her settings.
HPD> This is why Microsoft in Visual Studio uses Twips (1/20 pt) instead of
HPD> pixels, for all component positions and extents. In Delphi such scaling
HPD> is implemented by the Scaled and PixelsPerInch form properties.
Twips... they drives me crazy in my VB years :)
HPD> Delphi controls have a ScalingFlags property, indicating which
HPD> properties already have been scaled. A second property of that type
HPD> could indicate *which* of these properties should [not] be scaled at
HPD> all, so that scaling could be turned off for graphical controls which
HPD> contain neither text nor scale nicely (bitmaps...). Or a single boolean
HPD> value [Scaled?] could specify whether the control has to be resized at
HPD> all, while its position always should scale together with all other
I found no way in LCL, I'm not running Delphi since a lot of time. Any
scale concept should be IMHO or very simple 1,2 more properties or
quite complex covering almost all combinations. Trying to do almost
every possibility with only a few properties is usually a big problem.
HPD> Nice concept :-)
Thank you. The main advantage is that you can register a specific ScaleBy
procedure for special controls or derived ones. The rest of the code
is quite simple.
More information about the Lazarus