Class: Pango::FontMap

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Overview

The Pango::FontMapClass structure holds the virtual functions for a particular Pango::FontMap implementation.

Instance Method Summary collapse

Instance Method Details

#changednil

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.

Returns:

  • (nil)

#create_contextPango::Context

Creates a Pango::Context connected to fontmap. 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.

Returns:

  • (Pango::Context)

    the newly allocated Pango::Context, which should be freed with g_object_unref().

#list_families(families, n_families) ⇒ nil

List all families for a fontmap.

Parameters:

  • families (Array<Pango::FontFamily>)

    location to store a pointer to an array of Pango::FontFamily *. This array should be freed with g_free().

  • n_families (Integer)

    location to store the number of elements in families

Returns:

  • (nil)

#load_font(context, desc) ⇒ Pango::Font

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

Parameters:

  • context (Pango::Context)

    the Pango::Context the font will be used with

  • desc (Pango::FontDescription)

    a Pango::FontDescription describing the font to load

Returns:

  • (Pango::Font)

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

#load_fontset(context, desc, language) ⇒ Pango::Fontset

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

Parameters:

  • context (Pango::Context)

    the Pango::Context the font will be used with

  • desc (Pango::FontDescription)

    a Pango::FontDescription describing the font to load

  • language (Pango::Language)

    a Pango::Language the fonts will be used for

Returns:

  • (Pango::Fontset)

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

#serialInteger

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.

Returns:

  • (Integer)

    The current serial number of fontmap.