A font typeface for rendering text.
Font(file_dir: str | PathLike, pt_size: int) → FontFont(file_dir: str | PathLike, pt_size: int) → Font
A font typeface for rendering text.
| Name | Description | Type |
|---|---|---|
alignment | Get or set the text alignment for wrapped text. | TextAlign |
ascent | Get the pixel ascent of the font. | int |
bold | Get or set whether bold text style is enabled. | bool |
descent | Get the pixel descent of the font. | int |
height | Get the maximum pixel height of all glyphs in the font. | int |
hinting | Get or set the font hinting mode. | FontHint |
italic | Get or set whether italic text style is enabled. | bool |
kerning | Get or set whether kerning is enabled. | bool |
line_spacing | Get or set the spacing between lines of text in pixels. | int |
outline | Get or set the outline width in pixels (0 for no outline). | int |
pt_size | Get or set the point size of the font. Values below 8 are clamped to 8. | int |
strikethrough | Get or set whether strikethrough text style is enabled. | bool |
underline | Get or set whether underline text style is enabled. | bool |