zscript-doc/api/drawing/Font.md

62 lines
1.2 KiB
Markdown
Raw Normal View History

2018-12-29 16:05:19 -08:00
# Font
A font as defined in `FONTDEFS` or a bitmap font file. **Not serializable. Do
not use as a member unless marked as `transient`.**
2018-12-29 16:05:19 -08:00
```
struct Font
{
static Font FindFont(name fontname);
static int FindFontColor(name color);
static Font GetFont(name fontname);
2018-12-29 20:04:32 -08:00
double GetBottomAlignOffset(int code);
2018-12-29 16:05:19 -08:00
int GetCharWidth(int code);
string GetCursor();
int GetHeight();
int StringWidth(string code);
BrokenLines BreakLines(string text, int maxlen);
}
```
- `FindFont`
Gets a font as defined in `FONTDEFS`.
- `FindFontColor`
Returns the color range enumeration for a named color.
- `GetFont`
Gets a font either as defined in `FONTDEFS` or a ZDoom/bitmap font.
2018-12-29 20:04:32 -08:00
- `GetBottomAlignOffset`
2018-12-29 21:25:10 -08:00
Returns the baseline for the character `code`.
2018-12-29 20:04:32 -08:00
2018-12-29 16:05:19 -08:00
- `GetCharWidth`
Returns the width in pixels of a character code.
- `GetCursor`
Returns the string used as a blinking cursor graphic for this font.
- `GetHeight`
Returns the line height of the font.
- `StringWidth`
Returns the width in pixels of the string.
- `BreakLines`
Breaks `text` up into a `BrokenLines` structure according to the screen and
clip region, as well as appropriately accounting for a maximum width in
pixels of `maxlen`.
2018-12-29 16:05:19 -08:00
<!-- EOF -->