Pango.FontMap¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
|||
r |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Pango.FontMap(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
A
PangoFontMap
represents the set of fonts available for a particular rendering system.This is a virtual object with implementations being specific to particular rendering systems.
- changed()[source]¶
Forces a change in the context, which will cause any
PangoContext
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
PangoContext
, which should be freed withGObject.Object.unref
().- Return type:
Creates a
PangoContext
connected to self.This is equivalent to [ctor`Pango`.Context.new] followed by [method`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
PangoContext
. For instance, the GTK toolkit has, among others, gtk_widget_get_pango_context(). Use those instead.New in version 1.22.
- get_family(name)[source]¶
- Parameters:
name (
str
) – a family name- Returns:
the
PangoFontFamily
- Return type:
Gets a font family by name.
New in version 1.46.
- get_serial()[source]¶
- Returns:
The current serial number of self.
- Return type:
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
PangoFontMap
, like inPangoContext
.New in version 1.32.4.
- list_families()[source]¶
- Returns:
location to store a pointer to an array of
PangoFontFamily
*. This array should be freed withGLib.free
().- Return type:
families: [
Pango.FontFamily
]
List all families for a fontmap.
Note that the returned families are not in any particular order.
PangoFontMap
also implemented the [iface`Gio`.ListModel] interface for enumerating families.
- load_font(context, desc)[source]¶
- Parameters:
context (
Pango.Context
) – thePangoContext
the font will be used withdesc (
Pango.FontDescription
) – aPangoFontDescription
describing the font to load
- Returns:
the newly allocated
PangoFont
loaded, orNone
if no font matched.- Return type:
Pango.Font
orNone
Load the font in the fontmap that is the closest match for desc.
- load_fontset(context, desc, language)[source]¶
- Parameters:
context (
Pango.Context
) – thePangoContext
the font will be used withdesc (
Pango.FontDescription
) – aPangoFontDescription
describing the font to loadlanguage (
Pango.Language
) – aPangoLanguage
the fonts will be used for
- Returns:
the newly allocated
PangoFontset
loaded, orNone
if no font matched.- Return type:
Load a set of fonts in the fontmap that can be used to render a font matching desc.
- reload_font(font, scale, context, variations)[source]¶
- Parameters:
font (
Pango.Font
) – a font in selfscale (
float
) – the scale factor to applycontext (
Pango.Context
orNone
) – aPangoContext
- Returns:
the modified font
- Return type:
Returns a new font that is like font, except that its size is multiplied by scale, its backend-dependent configuration (e.g. cairo font options) is replaced by the one in context, and its variations are replaced by variations.
New in version 1.52.
- do_changed() virtual¶
Forces a change in the context, which will cause any
PangoContext
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_family(name) virtual¶
- Parameters:
name (
str
) – a family name- Returns:
the
PangoFontFamily
- Return type:
Gets a font family by name.
New in version 1.46.
- do_get_serial() virtual¶
- Returns:
The current serial number of fontmap.
- Return type:
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
PangoFontMap
, like inPangoContext
.New in version 1.32.4.
- do_list_families() virtual¶
- Returns:
location to store a pointer to an array of
PangoFontFamily
*. This array should be freed withGLib.free
().- Return type:
families: [
Pango.FontFamily
]
List all families for a fontmap.
Note that the returned families are not in any particular order.
PangoFontMap
also implemented the [iface`Gio`.ListModel] interface for enumerating families.
- do_load_font(context, desc) virtual¶
- Parameters:
context (
Pango.Context
) – thePangoContext
the font will be used withdesc (
Pango.FontDescription
) – aPangoFontDescription
describing the font to load
- Returns:
the newly allocated
PangoFont
loaded, orNone
if no font matched.- Return type:
Pango.Font
orNone
Load the font in the fontmap that is the closest match for desc.
- do_load_fontset(context, desc, language) virtual¶
- Parameters:
context (
Pango.Context
) – thePangoContext
the font will be used withdesc (
Pango.FontDescription
) – aPangoFontDescription
describing the font to loadlanguage (
Pango.Language
) – aPangoLanguage
the fonts will be used for
- Returns:
the newly allocated
PangoFontset
loaded, orNone
if no font matched.- Return type:
Load a set of fonts in the fontmap that can be used to render a font matching desc.
Property Details¶
- Pango.FontMap.props.item_type¶
- Name:
item-type
- Type:
- Default Value:
<GType GObject>
- Flags:
The type of items contained in this list.