Pango.FontMap

g GObject.Object GObject.Object Pango.FontMap Pango.FontMap GObject.Object->Pango.FontMap

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
  changed ()
  create_context ()
  get_serial ()
  get_shape_engine_type ()
  list_families ()
  load_font (context, desc)
  load_fontset (context, desc, language)

Virtual Methods

Inherited:GObject.Object (7)
  do_changed ()
  do_get_serial ()
  do_list_families ()
  do_load_font (context, desc)
  do_load_fontset (context, desc, language)

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.FontMap(**kwargs)
Bases:GObject.Object
Abstract:Yes
Structure:Pango.FontMapClass

The Pango.FontMap represents the set of fonts available for a particular rendering system. This is a virtual object with implementations being specific to particular rendering systems. To create an implementation of a Pango.FontMap, the rendering-system specific code should allocate a larger structure that contains a nested Pango.FontMap, fill in the klass member of the nested Pango.FontMap with a pointer to a appropriate Pango.FontMapClass, then call pango_font_map_init() on the structure.

The Pango.FontMap structure contains one member which the implementation fills in.

changed()[source]

Forces a change in the context, which will cause any Pango.Context using this fontmap to change.

This function is only useful when implementing a new backend for Pango, something applications won’t do. Backends should call this function if they have attached extra data to the context and such data is changed.

New in version 1.34.

create_context()[source]
Returns:the newly allocated Pango.Context, which should be freed with GObject.Object.unref().
Return type:Pango.Context

Creates a Pango.Context connected to self. This is equivalent to Pango.Context.new() followed by Pango.Context.set_font_map().

If you are using Pango as part of a higher-level system, that system may have it’s own way of create a Pango.Context. For instance, the GTK+ toolkit has, among others, gdk_pango_context_get_for_screen(), and gtk_widget_get_pango_context(). Use those instead.

New in version 1.22.

get_serial()[source]
Returns:The current serial number of self.
Return type:int

Returns the current serial number of self. The serial number is initialized to an small number larger than zero when a new fontmap is created and is increased whenever the fontmap is changed. It may wrap, but will never have the value 0. Since it can wrap, never compare it with “less than”, always use “not equals”.

The fontmap can only be changed using backend-specific API, like changing fontmap resolution.

This can be used to automatically detect changes to a Pango.FontMap, like in Pango.Context.

New in version 1.32.4.

get_shape_engine_type()[source]
Returns:the ID string for shape engines for this fontmap. Owned by Pango, should not be modified or freed.
Return type:str

Returns the render ID for shape engines for this fontmap. See the render_type field of Pango.EngineInfo.

New in version 1.4.

Deprecated since version 1.38.

list_families()[source]
Returns:location to store a pointer to an array of Pango.FontFamily *. This array should be freed with GLib.free().
Return type:families: [Pango.FontFamily]

List all families for a fontmap.

load_font(context, desc)[source]
Parameters:
Returns:

the newly allocated Pango.Font loaded, or None if no font matched.

Return type:

Pango.Font or None

Load the font in the fontmap that is the closest match for desc.

load_fontset(context, desc, language)[source]
Parameters:
Returns:

the newly allocated Pango.Fontset loaded, or None if no font matched.

Return type:

Pango.Fontset or None

Load a set of fonts in the fontmap that can be used to render a font matching desc.

do_changed() virtual

Forces a change in the context, which will cause any Pango.Context using this fontmap to change.

This function is only useful when implementing a new backend for Pango, something applications won’t do. Backends should call this function if they have attached extra data to the context and such data is changed.

New in version 1.34.

do_get_serial() virtual
Returns:The current serial number of fontmap.
Return type:int

Returns the current serial number of fontmap. The serial number is initialized to an small number larger than zero when a new fontmap is created and is increased whenever the fontmap is changed. It may wrap, but will never have the value 0. Since it can wrap, never compare it with “less than”, always use “not equals”.

The fontmap can only be changed using backend-specific API, like changing fontmap resolution.

This can be used to automatically detect changes to a Pango.FontMap, like in Pango.Context.

New in version 1.32.4.

do_list_families() virtual
Returns:location to store a pointer to an array of Pango.FontFamily *. This array should be freed with GLib.free().
Return type:families: [Pango.FontFamily]

List all families for a fontmap.

do_load_font(context, desc) virtual
Parameters:
Returns:

the newly allocated Pango.Font loaded, or None if no font matched.

Return type:

Pango.Font or None

Load the font in the fontmap that is the closest match for desc.

do_load_fontset(context, desc, language) virtual
Parameters:
Returns:

the newly allocated Pango.Fontset loaded, or None if no font matched.

Return type:

Pango.Fontset or None

Load a set of fonts in the fontmap that can be used to render a font matching desc.