[Lazarus] Lazarus has unique font sizes

Michael Van Canneyt michael at freepascal.org
Sat Aug 15 17:57:38 CEST 2009



On Sat, 15 Aug 2009, Graeme Geldenhuys wrote:

> Vincent Snijders wrote:
>> 
>> Google found for me http://support.microsoft.com/kb/32667
>> 
>> It is not Delphi specific, but has windows roots.
>
> I still don't know how they got to negative font height idea. The Xlib and 
> Xft font metrics documentation, and various other docs on the net, defines 
> font height as the Ascent + Descent. And that is how I implemented it in 
> fpGUI, and how it's implemented in a few other GUI toolkits I looked at.

There is a difference between font size and height. From the D7 help:

----------------------------------------------------------------------------
The value of Height can be obtained from the point size using this formula:

Font.Height = -Font.Size * Font.PixelsPerInch / 72

When the Height property has a positive value, the Size property has a negative value. 
When the Size property has a positive value, the Height property has a negative value.
----------------------------------------------------------------------------

I never thought this strange. The positive one is the one that was actually
set, the negative one was the one that was calculated from the set one ?

Am I missing something ?

Michael.






More information about the Lazarus mailing list