SourceClass FontData
from egui import FontDataclass FontData:A .ttf or .otf file and a font face index.
Properties§
@property
def font(self, /) -> bytes§
@font.setter
def font(self, /, font: Sequence[int]) -> None§
@property
def index(self, /) -> int§
@index.setter
def index(self, /, index: int) -> None§
Source@property
def tweak(self, /) -> FontTweak§
@tweak.setter
def tweak(self, /, tweak: FontTweak) -> None§
Methods§
def byte_len(self, /) -> int§
@staticmethod
def from_bytes(font: Sequence[int]) -> FontData§
Source@staticmethod
def from_owned(font: Sequence[int]) -> FontData§
Sourcedef variation_axes(self, /) -> list[FontVariationAxis]§
The variation axes of this font, e.g. wght (weight) and wdth (width).
Use this to discover which axes a variable font supports, and their valid
ranges, so a UI can offer the right knobs instead of making the user guess
tags and values for FontTweak.coords.
Returns an empty list for non-variable (static) fonts, or if the font data fails to parse.