pango.Fontset
Prev | The pango Class Reference | Next

## pango.Fontset

pango.Fontset — an object containing a set of `pango.Font` objects.

## Synopsis

    class pango.Fontset(gobject.GObject):
        def get_font(wc)
        def get_metrics()
        def foreach(func, data=None)

## Ancestry

    +-- gobject.GObject
      +-- pango.Fontset

## Description

A `pango.Fontset` object holds a set of `pango.Font` objects. A `pango.FontSet` object is returned from the following methods:

- `pango.Context.load_fontset`()
- `pango.FontMap.load_fontset`()

## Methods

### pango.Fontset.get_font

        def get_font(wc)

`wc` : | a unicode character
Returns : | a `pango.Font`.

The `get_font`() method returns the `pango.Font` in the fontset that contains the best glyph for the unicode character specified by `wc`.

### pango.Fontset.get_metrics

        def get_metrics()

Returns : | a `pango.FontMetrics` object.

The `get_metrics`() method returns a `pango.FontMetrics` object that contains the overall metric information for the fonts in the fontset.

### pango.Fontset.foreach

        def foreach(func, data=None)

`func` : | a callback function
`data` : | user data to pass to `func`

### Note

This method is available in PyGTK 2.4 and above.

The `foreach`() method invokes the function specified by `func` on each `pango.Font` of the font set passing it the optional user data specified by `data`. The signature of `func` is:

      def func(fontset, font, user_data)

where `fontset` is the `pango.Fontset` containing the `pango.Font` `font` and `user_data` is `data`

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