Font
A font used by Text objects.
Constructor
Font(file_dir: str, pt_size: int)Parameters
file_dir: Path to a .ttf font file, or one of the built-in names "kraken-clean" or "kraken-retro".pt_size: The point size. Values below 8 are clamped to 8. For "kraken-retro", the size is rounded to the nearest multiple of 8 to preserve pixel alignment.
Properties
| Name | Description | Type |
|---|---|---|
alignment | The alignment of the font when drawing text. | Align |
hinting | The font hinting mode. | FontHint |
pt_size | The point size of the font. | int |
bold | Whether the font is bold. | bool |
italic | Whether the font is italic. | bool |
underline | Whether the font is underlined. | bool |
strikethrough | Whether the font is strikethrough. | bool |
height | The height of the font in pixels. | int |
ascent | The ascent of the font in pixels. | int |
descent | The descent of the font in pixels. | int |
line_spacing | The line spacing of the font in pixels. | int |
kerning | Whether kerning is enabled for the font. | bool |
outline | The outline thickness of the font in pixels. | int |