Difference between revisions of "Font"

From Free Pascal wiki
Jump to navigationJump to search
Line 5: Line 5:
  
 
However, due to Windows and Delphi compatibility, height might be described in 2 values, negative and positive.
 
However, due to Windows and Delphi compatibility, height might be described in 2 values, negative and positive.
 +
 +
[[File:font_height.png]]
  
 
Negative value takes into account only the height of font characters.
 
Negative value takes into account only the height of font characters.
 
[[File:font_height.png]]
 
  
 
Positive value takes into account height of font characters plus additional space on top of the font. (So, it would be possible to write a line of the text right after another, without adding any extra space, and the font would not look too densed).
 
Positive value takes into account height of font characters plus additional space on top of the font. (So, it would be possible to write a line of the text right after another, without adding any extra space, and the font would not look too densed).

Revision as of 00:28, 10 January 2020

TFont class describes a typographic font information

Height

The height property specifies the font height in Pixels.

However, due to Windows and Delphi compatibility, height might be described in 2 values, negative and positive.

font height.png

Negative value takes into account only the height of font characters.

Positive value takes into account height of font characters plus additional space on top of the font. (So, it would be possible to write a line of the text right after another, without adding any extra space, and the font would not look too densed).

Normally, you want to use Negative font height.

Size

Is the size of the font in Typographic points.

In order to convert from Typographic points to Pixels one should use a device (Screen or Printer) dots per point value (DPI)

The size is also using Positive and Negative values, but in reverse order.