Pango.FontFamily

g GObject.GInterface GObject.GInterface Gio.ListModel Gio.ListModel GObject.GInterface->Gio.ListModel GObject.Object GObject.Object Pango.FontFamily Pango.FontFamily GObject.Object->Pango.FontFamily Gio.ListModel->Pango.FontFamily

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.ListModel (4)

Structs:

GObject.ObjectClass (5)

get_face (name)

get_name ()

is_monospace ()

is_variable ()

list_faces ()

Virtual Methods

Inherited:

GObject.Object (7), Gio.ListModel (3)

do_get_face (name)

do_get_name ()

do_is_monospace ()

do_is_variable ()

do_list_faces ()

Properties

Name

Type

Flags

Short Description

is-monospace

bool

r

is-variable

bool

r

item-type

GObject.GType

r

n-items

int

r

name

str

r

Signals

Inherited:

GObject.Object (1), Gio.ListModel (1)

Fields

Inherited:

GObject.Object (1), Gio.ListModel (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Pango.FontFamily(**kwargs)
Bases:

GObject.Object, Gio.ListModel

Abstract:

Yes

Structure:

Pango.FontFamilyClass

A PangoFontFamily is used to represent a family of related font faces.

The font faces in a family share a common design, but differ in slant, weight, width or other aspects.

get_face(name)[source]
Parameters:

name (str or None) – the name of a face. If the name is None, the family’s default face (fontconfig calls it “Regular”) will be returned.

Returns:

the PangoFontFace, or None if no face with the given name exists.

Return type:

Pango.FontFace or None

Gets the PangoFontFace of self with the given name.

New in version 1.46.

get_name()[source]
Returns:

the name of the family. This string is owned by the family object and must not be modified or freed.

Return type:

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()[source]
Returns:

True if the family is monospace.

Return type:

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. GLib.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 [method`Pango`.FontMetrics.get_approximate_digit_width], since the results of [method`Pango`.FontMetrics.get_approximate_char_width] may be affected by double-width characters.

New in version 1.4.

is_variable()[source]
Returns:

True if the family is variable

Return type:

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 [method`Pango`.FontDescription.set_variations] for more information.

New in version 1.44.

list_faces()[source]
Returns:

location to store an array of pointers to PangoFontFace objects, or None. This array should be freed with GLib.free() when it is no longer needed.

Return type:

faces: [Pango.FontFace]

Lists the different font faces that make up self.

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 the [iface`Gio`.ListModel] interface for enumerating faces.

do_get_face(name) virtual
Parameters:

name (str or None) – the name of a face. If the name is None, the family’s default face (fontconfig calls it “Regular”) will be returned.

Returns:

the PangoFontFace, or None if no face with the given name exists.

Return type:

Pango.FontFace or None

Gets the PangoFontFace of family with the given name.

New in version 1.46.

do_get_name() virtual
Returns:

the name of the family. This string is owned by the family object and must not be modified or freed.

Return type:

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() virtual
Returns:

True if the family is monospace.

Return type:

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. GLib.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 [method`Pango`.FontMetrics.get_approximate_digit_width], since the results of [method`Pango`.FontMetrics.get_approximate_char_width] may be affected by double-width characters.

New in version 1.4.

do_is_variable() virtual
Returns:

True if the family is variable

Return type:

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 [method`Pango`.FontDescription.set_variations] for more information.

New in version 1.44.

do_list_faces() virtual
Returns:

location to store an array of pointers to PangoFontFace objects, or None. This array should be freed with GLib.free() when it is no longer needed.

Return type:

faces: [Pango.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 the [iface`Gio`.ListModel] interface for enumerating faces.

Property Details

Pango.FontFamily.props.is_monospace
Name:

is-monospace

Type:

bool

Default Value:

False

Flags:

READABLE

Is this a monospace font

New in version 1.52.

Pango.FontFamily.props.is_variable
Name:

is-variable

Type:

bool

Default Value:

False

Flags:

READABLE

Is this a variable font

New in version 1.52.

Pango.FontFamily.props.item_type
Name:

item-type

Type:

GObject.GType

Default Value:

<GType GObject>

Flags:

READABLE

The type of items contained in this list.

Pango.FontFamily.props.n_items
Name:

n-items

Type:

int

Default Value:

0

Flags:

READABLE

The number of items contained in this list.

Pango.FontFamily.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE

The name of the family

New in version 1.52.