Font

A font typeface for rendering text.

Constructor

  • Font(file_dir: str, pt_size: SupportsInt) Font

A font typeface for rendering text.

Properties


NameDescriptionType
alignmentGet or set the text alignment for wrapped text.Align
ascentGet the pixel ascent of the font.int
boldGet or set whether bold text style is enabled.bool
descentGet the pixel descent of the font.int
heightGet the maximum pixel height of all glyphs in the font.int
hintingGet or set the font hinting mode.FontHint
italicGet or set whether italic text style is enabled.bool
kerningGet or set whether kerning is enabled.bool
line_spacingGet or set the spacing between lines of text in pixels.int
outlineGet or set the outline width in pixels (0 for no outline).int
pt_sizeGet or set the point size of the font. Values below 8 are clamped to 8.int
strikethroughGet or set whether strikethrough text style is enabled.bool
underlineGet or set whether underline text style is enabled.bool