It derives from <GObject>.
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.
parent-instanceThe type of items contained in this list.
Its value is a class, or a GType number.
It is read only.
The number of items contained in this list.
Its value is an unsigned 32-bit integer.
It is read only.
Loads a font file with one or more fonts into the
<PangoFontMap>.
The added fonts will take precedence over preexisting fonts with the same name.
Passed: a <PangoFontMap>.
Passed: a file name, as a string.
Path to the font file
Returned: a boolean.
True if the font file is successfully loaded into the fontmap, false if an error occurred.
Forces a change in the fontmap, 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 fontmap and such data is changed.
Passed: a <PangoFontMap>.
Creates a <PangoContext> connected to self.
This is equivalent to context:new followed by
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, widget:get-pango-context. Use those instead.
Passed: a <PangoFontMap>.
Returned: a <PangoContext>.
the newly allocated <PangoContext>, which should
be freed with object:unref.
Gets a font family by name.
Passed: a <PangoFontMap>.
Passed: a string.
a family name
Returned: a <PangoFontFamily>.
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 in
<PangoContext>.
Passed: a <PangoFontMap>.
Returned: an unsigned 32-bit integer.
The current serial number of self.
List all families for a fontmap.
Note that the returned families are not in any particular order.
<PangoFontMap> also implemented the
<GListModel> interface for enumerating
families.
Passed: a <PangoFontMap>.
Returned: a vector, each a <PangoFontFamily>.
location to store a pointer to an array of
<PangoFontFamily> *. This array should be
freed with byte-array:free.
Not returned: it is the length of families.
location to store the number of elements in families
Load the font in the fontmap that is the closest match for desc.
Passed: a <PangoFontMap>.
Passed: a <PangoContext>.
the <PangoContext> the font will be used with
Passed: a <PangoFontDescription>.
a <PangoFontDescription> describing the
font to load
Returned: a <PangoFont>, or #f.
the newly allocated <PangoFont> loaded, or #f
if no font matched.
Load a set of fonts in the fontmap that can be used to render a font matching desc.
Passed: a <PangoFontMap>.
Passed: a <PangoContext>.
the <PangoContext> the font will be used with
Passed: a <PangoFontDescription>.
a <PangoFontDescription> describing the
font to load
Passed: a <PangoLanguage>.
a <PangoLanguage> the fonts will be used for
Returned: a <PangoFontset>, or #f.
the newly allocated <PangoFontset> loaded, or
#f if no font matched.
Returns a new font that is like font, except that it is scaled 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.
Note that the scaling here is meant to be linear, so this scaling can be used to render a font on a hi-dpi display without changing its optical size.
Passed: a <PangoFontMap>.
Passed: a <PangoFont>.
a font in self
Passed: a real number.
the scale factor to apply
Passed, or left out: a <PangoContext>, or
#f.
Passed, or left out: a string, or #f.
font variations to use
Returned: a <PangoFont>.
the modified font
Forces a change in the fontmap, 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 fontmap and such data is changed.
To override it in a new class, give register-type #:vfuncs
`((changed . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<PangoFontMap>, or a class that derives from it,
or its GType number.
Passed: a <PangoFontMap>.
Gets a font family by name.
To override it in a new class, give register-type #:vfuncs
`((get-family . ,procedure)). The procedure is called as
(procedure self name) ⇒ %return.
Passed: the class whose implementation to call:
<PangoFontMap>, or a class that derives from it,
or its GType number.
Passed: a <PangoFontMap>.
Passed: a string.
a family name
Returned: a <PangoFontFamily>.
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 in
<PangoContext>.
To override it in a new class, give register-type #:vfuncs
`((get-serial . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<PangoFontMap>, or a class that derives from it,
or its GType number.
Passed: a <PangoFontMap>.
Returned: an unsigned 32-bit integer.
The current serial number of self.
List all families for a fontmap.
Note that the returned families are not in any particular order.
<PangoFontMap> also implemented the
<GListModel> interface for enumerating
families.
To override it in a new class, give register-type #:vfuncs
`((list-families . ,procedure)). The procedure is called as
(procedure self) ⇒ families.
Passed: the class whose implementation to call:
<PangoFontMap>, or a class that derives from it,
or its GType number.
Passed: a <PangoFontMap>.
Returned: a vector, each a <PangoFontFamily>.
location to store a pointer to an array of
<PangoFontFamily> *. This array should be
freed with byte-array:free.
Not returned: it is the length of families.
location to store the number of elements in families
Load the font in the fontmap that is the closest match for desc.
To override it in a new class, give register-type #:vfuncs
`((load-font . ,procedure)). The procedure is called as
(procedure self context desc) ⇒ %return.
Passed: the class whose implementation to call:
<PangoFontMap>, or a class that derives from it,
or its GType number.
Passed: a <PangoFontMap>.
Passed: a <PangoContext>.
the <PangoContext> the font will be used with
Passed: a <PangoFontDescription>.
a <PangoFontDescription> describing the
font to load
Returned: a <PangoFont>, or #f.
the newly allocated <PangoFont> loaded, or #f
if no font matched.
Load a set of fonts in the fontmap that can be used to render a font matching desc.
To override it in a new class, give register-type #:vfuncs
`((load-fontset . ,procedure)). The procedure is called as
(procedure self context desc language) ⇒ %return.
Passed: the class whose implementation to call:
<PangoFontMap>, or a class that derives from it,
or its GType number.
Passed: a <PangoFontMap>.
Passed: a <PangoContext>.
the <PangoContext> the font will be used with
Passed: a <PangoFontDescription>.
a <PangoFontDescription> describing the
font to load
Passed: a <PangoLanguage>.
a <PangoLanguage> the fonts will be used for
Returned: a <PangoFontset>, or #f.
the newly allocated <PangoFontset> loaded, or
#f if no font matched.