S or /

SourceClass Typeface

from skia import Typeface
class Typeface:

Constants§

Slant: Final[type]§

Properties§

Source@property def family_name(self, /) -> str§

Returns the family name for this typeface as UTF-8.

@property def font_slant(self, /) -> int§
@property def font_weight(self, /) -> int§
@property def font_width(self, /) -> int§
@property def fontstyle(self, /) -> Fontstyle§
Source@property def is_fixed_pitch(self, /) -> bool§

Returns True if the typeface claims to be fixed-pitch.

This is a style bit; advance widths may vary even when this returns True.

Source@property def units_per_em(self, /) -> int§

Returns the units-per-em value for this typeface.

Returns None on error.

Methods§

@classmethod def from_data(cls, /, data: Data, index: int) -> Typeface§
@classmethod def from_file(cls, /, path: str, index: int) -> Typeface§
@classmethod def from_name(cls, /, name: str, style: Fontstyle |None = None) -> Typeface§