Re: [Lazarus] TFont.size

2009-05-02 Thread zeljko
On Friday 01 May 2009 22:35, Felipe Monteiro de Carvalho wrote:
 Hello,

 Does anyone the difference between TFont.Height and TFont.Size?

 It seams to me that Height is measured in pixels and Size is some
 other unit which I don't know. Even worse, it doesn't seam to be an
 international system unit, but rather an american unit (some fraction
 of inches).

 The Delphi docs say:

 Use Size to specify the point size of the font. If the value is
 negative, the internal leading that appears at the top of each line of
 text is included. If the value is positive, Size represents the height
 of the characters but not the internal leading.

 To determine the size of the font in pixels, use the Height property
 instead. The value of Size can be obtained from the height in pixels
 using this formula:

 Copy Code
 Font.Size = -Font.Height * 72 / Font.PixelsPerInch
 When the Size property has a positive value, the Height property has a
 negative value. When the Height property has a positive value, the
 Size property has a negative value. 

 A rather exoteric property IMHO. Or yet another Windowsism in Delphi

No, it's not Windowsism, qt have the same thing on all platforms.
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TFont.size

2009-05-01 Thread Felipe Monteiro de Carvalho
Hello,

Does anyone the difference between TFont.Height and TFont.Size?

It seams to me that Height is measured in pixels and Size is some
other unit which I don't know. Even worse, it doesn't seam to be an
international system unit, but rather an american unit (some fraction
of inches).

The Delphi docs say:

Use Size to specify the point size of the font. If the value is
negative, the internal leading that appears at the top of each line of
text is included. If the value is positive, Size represents the height
of the characters but not the internal leading.

To determine the size of the font in pixels, use the Height property
instead. The value of Size can be obtained from the height in pixels
using this formula:

Copy Code
Font.Size = -Font.Height * 72 / Font.PixelsPerInch
When the Size property has a positive value, the Height property has a
negative value. When the Height property has a positive value, the
Size property has a negative value. 

A rather exoteric property IMHO. Or yet another Windowsism in Delphi

-- 
Felipe Monteiro de Carvalho
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFont.size

2009-05-01 Thread Howard Page-Clark
On Fri, 1 May 2009 17:35:19 -0300
Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote:

 Hello,
 
 Does anyone the difference between TFont.Height and TFont.Size?
 
 ...
 A rather exoteric property IMHO. Or yet another Windowsism in Delphi

Not so much a Windowsism as baggage from the days before screens when
'printing' was never to a screen but only a process that transferred
ink from hand set lead typeface to paper. Traditionally type sizes were
measured in printer points, defined as 1/72 inch as measured by the
EM square of the font. The EM square is the size of the lead block
that would enclose a capital letter M (the block is fractionally
bigger than the actual printed size of the M).

The two different properties Delphi provides to set the size of a font
relate to the two possible expressions of the font: printing to paper
and 'printing' to the screen.

If you specify the font's size using the Font.Size property, the font
is scaled to match the size you specify in printer points.

If you specify the font's size using the Font.Height property, the font
is scaled in pixels. If you specify the Height as a positive value, the
font's external leading is included in the calculation. If you specify
a negative value, the font's external leading is not included in the
calculation. (Traditionally leading, pronounced like the metal lead,
means the line spacing, dating from the time when thin strips of lead
were placed between lines of type to increase the space between lines).


Howard
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFont.size

2009-05-01 Thread Jesus Reyes




--- El vie 1-may-09, Felipe Monteiro de Carvalho 
felipemonteiro.carva...@gmail.com escribió:

 It seams to me that Height is measured in pixels and Size
 is some
 other unit which I don't know. Even worse, it
 doesn't seam to be an
 international system unit, but rather an american unit
 (some fraction
 of inches).

Points, where 1 Point = 1/72 inch. 

Why using points instead of just pixels?, it's convenient because you can 
forget about resolution, for example one might want to show some text on 
screen, maybe 20 pixels height would look nice for a big title, but that is so 
because screen resolution is perhaps 96 pixels per inch, but what happen when 
the text is printed on a 1200 dpi printer? it will probably do not stand out, 
so without points one would need a way to specify pixel heights for several 
resolutions. So a good property of points is that they are independent of 
resolution.

Jesus Reyes A.


  ¡Obtén la mejor experiencia en la web! Descarga gratis el nuevo Internet 
Explorer 8. http://downloads.yahoo.com/ieak8/?l=mx

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus