Pango.FontFamily

g GObject.Object GObject.Object Pango.FontFamily Pango.FontFamily GObject.Object->Pango.FontFamily

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
  get_face (name)
  get_name ()
  is_monospace ()
  is_variable ()
  list_faces ()

Virtual Methods

Inherited:GObject.Object (7)
  do_get_face (name)
  do_get_name ()
  do_is_monospace ()
  do_is_variable ()
  do_list_faces ()

Properties

None

Signals

Inherited:GObject.Object (1)

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent_instance GObject.Object r  

Class Details

class Pango.FontFamily(**kwargs)
Bases:GObject.Object
Abstract:Yes
Structure:Pango.FontFamilyClass

The Pango.FontFamily structure is used to represent a family of related font faces. The faces in a family share a common design, but differ in slant, weight, width and 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 Pango.FontFace, or None if no face with the given name exists.
Return type:Pango.FontFace or None

Gets the Pango.FontFace 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 Pango.FontDescription 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 Pango.FontMetrics.get_approximate_digit_width(), since the results of 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.

New in version 1.44.

list_faces()[source]
Returns:location to store an array of pointers to Pango.FontFace 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.

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 Pango.FontFace, or None if no face with the given name exists.
Return type:Pango.FontFace or None

Gets the Pango.FontFace 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 Pango.FontDescription 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 Pango.FontMetrics.get_approximate_digit_width(), since the results of 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.

New in version 1.44.

do_list_faces() virtual
Returns:location to store an array of pointers to Pango.FontFace 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.