Not too shy to talk
Joined: 2006/11/26 17:45 Last Login
: Yesterday 15:48
Group:
Registered Users
|
Please define "system" font.
Please define "size".
The font that usually is called the "system font" is the fixed-width font you define in Prefs/Font. It is the default font for all RastPorts, but it is not used for GUI elements. The default font for GUI elements is the screen font. You can get it from Screen->RastPort.Font (pointer to struct TextFont) or Screen->Font (pointer to struct TextAttr).
The size of a font usually means its height. Therefore you can get the size of a font from TextFont->tf_YSize or TextAttr->ta_YSize. Or Screen->RastPort.TxHeight.
If you want the width of a given text you should use the TextLength function.
Some fonts, especially outline fonts, might need more pixels than derived from TxHeight / TextLength. To get the real area a given text needs to be printed, you should use the TextExtent function.
|