Difference between revisions of "Font"
Jwdietrich (talk | contribs) (Categorisation) |
Jwdietrich (talk | contribs) (Adding additional useful information.#) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | TFont class describes a typographic font information | + | TFont class describes a typographic font information. The [[LCL]] defines the following [[Property|properties]]: |
+ | |||
+ | === Color === | ||
+ | Sets the [[Colors|colour]] of the text to be displayed. | ||
===Height=== | ===Height=== | ||
Line 13: | Line 16: | ||
Normally, you want to use Negative font height. | Normally, you want to use Negative font height. | ||
+ | |||
+ | ===Name=== | ||
+ | The name property defines the name of the font to be used. | ||
+ | |||
+ | ===Pitch=== | ||
+ | This property determines the spacing between the letters. It may have one of the following values: | ||
+ | * ''fpDefault'' | ||
+ | * ''fpFixed'' | ||
+ | * ''fxVariable'' | ||
===Size=== | ===Size=== | ||
Line 34: | Line 46: | ||
In this example, the selected font would have Font.Size=16 | In this example, the selected font would have Font.Size=16 | ||
− | ===Size to Height=== | + | ====Size to Height==== |
Once should use the following formal to convert from Size to height | Once should use the following formal to convert from Size to height | ||
Line 45: | Line 57: | ||
Note, the use of negative , due to reverse logic. | Note, the use of negative , due to reverse logic. | ||
+ | |||
+ | ===Style=== | ||
+ | Defines the style of the text to be displayed or printed. | ||
[[Category:GUI]] | [[Category:GUI]] | ||
+ | [[Category:LCL]] |
Latest revision as of 20:34, 29 March 2020
TFont class describes a typographic font information. The LCL defines the following properties:
Color
Sets the colour of the text to be displayed.
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.
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.
Name
The name property defines the name of the font to be used.
Pitch
This property determines the spacing between the letters. It may have one of the following values:
- fpDefault
- fpFixed
- fxVariable
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.
Positive value takes into account only the height of font characters. (it's a typographic standard)
Negative 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 dense).
Normally, you want to use Positive font size values.
It might be useful to note, that User Interface is typically presenting the size in typographs points.
In this example, the selected font would have Font.Size=16
Size to Height
Once should use the following formal to convert from Size to height
Font.Height := -Font.Size * DPI / 72
and from Height to Size
Font.Size := -Font.Height / DPI * 72
Note, the use of negative , due to reverse logic.
Style
Defines the style of the text to be displayed or printed.