Graphics Context - Font

The Font

The font is the graphics context object that controls how text is drawn. The font always has type TFont and the current font can be accessed via the datum Font.

A new font can only be construct based on an existing font, using the structure modification operator. The current default font is always constant.

The TFont Type

The TFont type is a system defined structure with the following fields :-

Text typeface

The typeface is the name by which the operating system knows the font - e.g. "Courier New". You can get a list of fonts on your system by running Notepad and invoking the Format/Font... menu. If you are writing a program to be used on other systems you should use a standard font.

The fonts are managed by the operating system so it is possible that some features may not work the same for all fonts. You may need to experiment to find what works best for your chosen font.

Number size

The size specifies the font height in pixels.

Number weight

The weight defines how bold the characters are written. This parameter must be in the range 0 to 100, standard weight is 50.

Logical italic

This specifies whether the font is italicised.

Logical underline

This specifies whether the font is underlined.