Skip to content

Pango.FontFace

class — extends GObject.Object

A PangoFontFace is used to represent a group of fonts with the same family, slant, weight, and width, but varying sizes.

Methods

describe

def describe(self) -> FontDescription

Returns a font description that matches the face.

The resulting font description will have the family, style, variant, weight and stretch of the face, but its size field will be unset.

get_face_name

def get_face_name(self) -> str

Gets a name representing the style of this face.

Note that a font family may contain multiple faces with the same name (e.g. a variable and a non-variable face for the same style).

get_family

def get_family(self) -> FontFamily

Gets the PangoFontFamily that face belongs to.

is_synthesized

def is_synthesized(self) -> bool

Returns whether a PangoFontFace is synthesized.

This will be the case if the underlying font rendering engine creates this face from another face, by shearing, emboldening, lightening or modifying it in some other way.

list_sizes

def list_sizes(self) -> list[int]

List the available sizes for a font.

This is only applicable to bitmap fonts. For scalable fonts, stores None at the location pointed to by sizes and 0 at the location pointed to by n_sizes. The sizes returned are in Pango units and are sorted in ascending order.

Virtual methods

do_describe

def do_describe(self) -> FontDescription

Returns a font description that matches the face.

The resulting font description will have the family, style, variant, weight and stretch of the face, but its size field will be unset.

do_get_face_name

def do_get_face_name(self) -> str

Gets a name representing the style of this face.

Note that a font family may contain multiple faces with the same name (e.g. a variable and a non-variable face for the same style).

do_get_family

def do_get_family(self) -> FontFamily

Gets the PangoFontFamily that face belongs to.

do_is_synthesized

def do_is_synthesized(self) -> bool

Returns whether a PangoFontFace is synthesized.

This will be the case if the underlying font rendering engine creates this face from another face, by shearing, emboldening, lightening or modifying it in some other way.

do_list_sizes

def do_list_sizes(self) -> list[int]

List the available sizes for a font.

This is only applicable to bitmap fonts. For scalable fonts, stores None at the location pointed to by sizes and 0 at the location pointed to by n_sizes. The sizes returned are in Pango units and are sorted in ascending order.