pango.FontMap
Prev | The pango Class Reference | Next

## pango.FontMap

pango.FontMap — an object that represents the set of fonts available for a particular rendering system.

## Synopsis

    class pango.FontMap(gobject.GObject):
        def create_context()
        def load_font(context, desc)
        def load_fontset(context, desc, language)
        def list_families()
        def get_shape_engine_type()

## Ancestry

    +-- gobject.GObject
      +-- pango.FontMap

## Description

A `pango.FontMap` object represents the set of fonts available for a particular rendering system. There appears to be no way to retrieve a `pango.FontMap` object in `PyGTK`.

## Methods

### pango.FontMap.create_context

        def create_context()

Returns : | the newly allocated `pango.Context`.

### Note

This method is available in PyGTK 2.16 and above.

Creates a `pango.Context` connected to fontmap. This is equivalent to calling the class constructor 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, gtk.gdk.pango_context_get_for_screen and gtk.Widget.get_pango_context. Use those instead.

### pango.FontMap.load_font

        def load_font(context, desc)

`context` : | the `pango.Context` the font will be used with
`desc` : | a `pango.FontDescription` describing the font to load
Returns : | the loaded font , or `None` if no font matched.

The `load_font`() method loads the `pango.Font` in the fontmap that is the closest match for the `pango.FontDescription` specified by `desc` in the `pango.Context` specified by `context`.

### pango.FontMap.load_fontset

        def load_fontset(context, desc, language)

`context` : | the `pango.Context` the font will be used with
`desc` : | a `pango.FontDescription` describing the font to load
`language` : | a `pango.Language` the fonts will be used for
Returns : | a `pango.FontSet`, or `None` if no font matched.

The `load_fontset`() method loads a set of `pango.Font` objects in the fontmap that can be used to render a font matching the `pango.FontDescription` specified by `desc` for the `pango.Language` specified by `language` in the `pango.Context` specified by `context`.

### pango.FontMap.list_families

        def list_families()

Returns : | a list of `pango.FontFamily` objects.

The `list_families`() method returns a list of all `pango.FontFamily` objects for the fontmap.

### pango.FontMap.get_shape_engine_type

        def get_shape_engine_type()

Returns : | the ID string for the shape engines for the font map.

### Note

This method is available in PyGTK 2.4 and above.

The `get_shape_engine_type`() method returns the render ID for the shape engines for the font map

Prev | Up | Next
pango.FontFamily | Home | pango.FontMetrics