FontFamily
Superclasses: Object
Implemented Interfaces: ListModel
- Constructors:
FontFamily(**properties)
Methods
- class FontFamily
- get_face(name: str | None = None) FontFace | None
Gets the
PangoFontFace
offamily
with the given name.Added in version 1.46.
- Parameters:
name – the name of a face. If the name is
None
, the family’s default face (fontconfig calls it “Regular”) will be returned.
- get_name() str
Gets the name of the family.
The name is unique among all fonts for the font backend and can be used in a
PangoFontDescription
to specify that a face from this family is desired.
- is_monospace() bool
A monospace font is a font designed for text display where the the characters form a regular grid.
For Western languages this would mean that the advance width of all characters are the same, but this categorization also includes Asian fonts which include double-width characters: characters that occupy two grid cells.
unichar_iswide()
returns a result that indicates whether a character is typically double-width in a monospace font.The best way to find out the grid-cell size is to call
get_approximate_digit_width
, since the results ofget_approximate_char_width
may be affected by double-width characters.Added in version 1.4.
- is_variable() bool
A variable font is a font which has axes that can be modified to produce different faces.
Such axes are also known as variations; see
set_variations
for more information.Added in version 1.44.
- list_faces() list[FontFace]
Lists the different font faces that make up
family
.The faces in a family share a common design, but differ in slant, weight, width and other aspects.
Note that the returned faces are not in any particular order, and multiple faces may have the same name or characteristics.
PangoFontFamily
also implemented theListModel
interface for enumerating faces.
Properties
- class FontFamily
Virtual Methods
- class FontFamily
- do_get_face(name: str | None = None) FontFace | None
Gets the
PangoFontFace
offamily
with the given name.Added in version 1.46.
- Parameters:
name – the name of a face. If the name is
None
, the family’s default face (fontconfig calls it “Regular”) will be returned.
- do_get_name() str
Gets the name of the family.
The name is unique among all fonts for the font backend and can be used in a
PangoFontDescription
to specify that a face from this family is desired.
- do_is_monospace() bool
A monospace font is a font designed for text display where the the characters form a regular grid.
For Western languages this would mean that the advance width of all characters are the same, but this categorization also includes Asian fonts which include double-width characters: characters that occupy two grid cells.
unichar_iswide()
returns a result that indicates whether a character is typically double-width in a monospace font.The best way to find out the grid-cell size is to call
get_approximate_digit_width
, since the results ofget_approximate_char_width
may be affected by double-width characters.Added in version 1.4.
- do_is_variable() bool
A variable font is a font which has axes that can be modified to produce different faces.
Such axes are also known as variations; see
set_variations
for more information.Added in version 1.44.
- do_list_faces() list[FontFace]
Lists the different font faces that make up
family
.The faces in a family share a common design, but differ in slant, weight, width and other aspects.
Note that the returned faces are not in any particular order, and multiple faces may have the same name or characteristics.
PangoFontFamily
also implemented theListModel
interface for enumerating faces.
Fields
- class FontFamily
- parent_instance