It derives from <GObject>.
A <PangoFont> is used to represent a font in a
rendering-system-independent manner.
parent-instanceReturns a description of the font, with font size set in points.
Use font:describe-with-absolute-size if you
want the font size in device units.
Passed: a <PangoFont>.
Returned: a <PangoFontDescription>.
a newly-allocated <PangoFontDescription>
object.
Returns a description of the font, with absolute font size set in device units.
Use font:describe if you want the font size
in points.
Passed: a <PangoFont>.
Returned: a <PangoFontDescription>.
a newly-allocated <PangoFontDescription>
object.
Frees an array of font descriptions.
Passed: a list or vector, each a
<PangoFontDescription>, or #f.
a pointer to an array of
<PangoFontDescription>, may be #f
Not passed: guile-gi gives the length of descs.
number of font descriptions in descs
Loads data previously created via font:serialize.
For a discussion of the supported format, see that function.
Note: to verify that the returned font is identical to the one that was serialized, you can compare bytes to the result of serializing the font again.
Passed: a <PangoContext>.
Passed: a <GBytes>.
the bytes containing the data
Returned: a <PangoFont>, or #f.
a new <PangoFont>
Computes the coverage map for a given font and language tag.
Passed: a <PangoFont>.
Passed: a <PangoLanguage>.
the language tag
Returned: a <PangoCoverage>.
a newly-allocated <PangoCoverage> object.
Gets the <PangoFontFace> to which self
belongs.
Note that this function can return NULL in cases where the font
outlives its font map.
Passed: a <PangoFont>.
Returned: a <PangoFontFace>, or #f.
the <PangoFontFace>
Obtain the OpenType features that are provided by the font.
These are passed to the rendering system, together with features that have been explicitly set via attributes.
Note that this does not include OpenType features which the rendering system enables by default.
Passed: a <PangoFont>.
Passed: a list or vector, each a <hb_feature_t>. It is filled
in, and returned: a vector, each a <hb_feature_t>.
Array to features in
Passed, and returned: an unsigned 32-bit integer.
the number of used items in features
Not returned: it is the length of features.
the length of features
Gets the font map for which the font was created.
Note that the font maintains a weak reference to the font map, so
if all references to font map are dropped, the font map will be
finalized even if there are fonts created with the font map that are
still alive. In that case this function will return #f.
It is the responsibility of the user to ensure that the font map is kept
alive. In most uses this is not an issue as a
<PangoContext> holds a reference to the font map.
Passed: a <PangoFont>.
Returned: a <PangoFontMap>, or #f.
the <PangoFontMap> for the font
Gets the logical and ink extents of a glyph within a font.
The coordinate system for each rectangle has its origin at the base line
and horizontal origin of the character with increasing coordinates
extending to the right and down. The macros PANGO_ASCENT(),
PANGO_DESCENT(), PANGO_LBEARING(), and
PANGO_RBEARING() can be used to convert from the extents
rectangle to more traditional font metrics. The units of the rectangles
are in 1/PANGO_SCALE of a device unit.
If self is #f, this function gracefully sets some sane
values in the output variables and returns.
Passed: a <PangoFont>.
Passed: an unsigned 32-bit integer.
the glyph index
Passed, filled in, and returned: a
<PangoRectangle>.
rectangle used to store the extents of the glyph as drawn
Passed, filled in, and returned: a
<PangoRectangle>.
rectangle used to store the logical extents of the glyph
Returns the languages that are supported by self.
If the font backend does not provide this information, #f is
returned. For the fontconfig backend, this corresponds to the FC_LANG
member of the FcPattern.
The returned array is only valid as long as the font and its fontmap are valid.
Passed: a <PangoFont>.
Returned: a vector, each a <PangoLanguage>, or
#f.
an array of <PangoLanguage>
Gets overall metric information for a font.
Since the metrics may be substantially different for different scripts, a language tag can be provided to indicate that the metrics should be retrieved that correspond to the script(s) used by that language.
If self is #f, this function gracefully sets some sane
values in the output variables and returns.
Passed: a <PangoFont>.
Passed, or left out: a <PangoLanguage>, or
#f.
language tag used to determine which script to get the metrics for, or
#f to indicate to get the metrics for the entire font.
Returned: a <PangoFontMetrics>.
a <PangoFontMetrics> object. The caller must
call font-metrics:unref when finished
using the object.
Returns whether the font provides a glyph for this character.
Passed: a <PangoFont>.
Passed: a character.
a Unicode character
Returned: a boolean.
TRUE if self can render wc
Serializes the self in a way that can be uniquely identified.
There are no guarantees about the format of the output across different versions of Pango.
The intended use of this function is testing, benchmarking and debugging. The format is not meant as a permanent storage format.
To recreate a font from its serialized form, use font:deserialize.
Passed: a <PangoFont>.
Returned: a <GBytes>.
a <GBytes> containing the serialized form of
self
To override it in a new class, give register-type #:vfuncs
`((create-hb-font . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<PangoFont>, or a class that derives from it, or its
GType number.
Passed: a <PangoFont>.
Returned: a <hb_font_t>.
Returns a description of the font, with font size set in points.
Use font:describe-with-absolute-size if you
want the font size in device units.
To override it in a new class, give register-type #:vfuncs
`((describe . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<PangoFont>, or a class that derives from it, or its
GType number.
Passed: a <PangoFont>.
Returned: a <PangoFontDescription>.
a newly-allocated <PangoFontDescription>
object.
To override it in a new class, give register-type #:vfuncs
`((describe-absolute . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<PangoFont>, or a class that derives from it, or its
GType number.
Passed: a <PangoFont>.
Returned: a <PangoFontDescription>.
Computes the coverage map for a given font and language tag.
To override it in a new class, give register-type #:vfuncs
`((get-coverage . ,procedure)). The procedure is called as
(procedure self language) ⇒ %return.
Passed: the class whose implementation to call:
<PangoFont>, or a class that derives from it, or its
GType number.
Passed: a <PangoFont>.
Passed: a <PangoLanguage>.
the language tag
Returned: a <PangoCoverage>.
a newly-allocated <PangoCoverage> object.
Obtain the OpenType features that are provided by the font.
These are passed to the rendering system, together with features that have been explicitly set via attributes.
Note that this does not include OpenType features which the rendering system enables by default.
To override it in a new class, give register-type #:vfuncs
`((get-features . ,procedure)). The procedure is called as
(procedure self features num-features) ⇒ num-features.
Passed: the class whose implementation to call:
<PangoFont>, or a class that derives from it, or its
GType number.
Passed: a <PangoFont>.
Passed: a list or vector, each a <hb_feature_t>. It is filled
in, and returned: a vector, each a <hb_feature_t>.
Array to features in
Passed, and returned: an unsigned 32-bit integer.
the number of used items in features
Not returned: it is the length of features.
the length of features
Gets the font map for which the font was created.
Note that the font maintains a weak reference to the font map, so
if all references to font map are dropped, the font map will be
finalized even if there are fonts created with the font map that are
still alive. In that case this function will return #f.
It is the responsibility of the user to ensure that the font map is kept
alive. In most uses this is not an issue as a
<PangoContext> holds a reference to the font map.
To override it in a new class, give register-type #:vfuncs
`((get-font-map . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<PangoFont>, or a class that derives from it, or its
GType number.
Passed: a <PangoFont>.
Returned: a <PangoFontMap>, or #f.
the <PangoFontMap> for the font
Gets the logical and ink extents of a glyph within a font.
The coordinate system for each rectangle has its origin at the base line
and horizontal origin of the character with increasing coordinates
extending to the right and down. The macros PANGO_ASCENT(),
PANGO_DESCENT(), PANGO_LBEARING(), and
PANGO_RBEARING() can be used to convert from the extents
rectangle to more traditional font metrics. The units of the rectangles
are in 1/PANGO_SCALE of a device unit.
If self is #f, this function gracefully sets some sane
values in the output variables and returns.
To override it in a new class, give register-type #:vfuncs
`((get-glyph-extents . ,procedure)). The procedure is called as
(procedure self glyph ink-rect logical-rect).
Passed: the class whose implementation to call:
<PangoFont>, or a class that derives from it, or its
GType number.
Passed: a <PangoFont>.
Passed: an unsigned 32-bit integer.
the glyph index
Passed, filled in, and returned: a
<PangoRectangle>.
rectangle used to store the extents of the glyph as drawn
Passed, filled in, and returned: a
<PangoRectangle>.
rectangle used to store the logical extents of the glyph
Gets overall metric information for a font.
Since the metrics may be substantially different for different scripts, a language tag can be provided to indicate that the metrics should be retrieved that correspond to the script(s) used by that language.
If self is #f, this function gracefully sets some sane
values in the output variables and returns.
To override it in a new class, give register-type #:vfuncs
`((get-metrics . ,procedure)). The procedure is called as
(procedure self language) ⇒ %return.
Passed: the class whose implementation to call:
<PangoFont>, or a class that derives from it, or its
GType number.
Passed: a <PangoFont>.
Passed, or left out: a <PangoLanguage>, or
#f.
language tag used to determine which script to get the metrics for, or
#f to indicate to get the metrics for the entire font.
Returned: a <PangoFontMetrics>.
a <PangoFontMetrics> object. The caller must
call font-metrics:unref when finished
using the object.