It derives from <GObject>.
<PangoRenderer> is a base class for objects that
can render text provided as <PangoGlyphString>
or <PangoLayout>.
By subclassing <PangoRenderer> and overriding
operations such as draw-glyphs and draw-rectangle, renderers
for particular font backends and destinations can be created.
matrixthe current transformation matrix for the Renderer; may be #f,
which should be treated the same as the identity matrix.
Does initial setup before rendering operations on self.
renderer:deactivate should be called
when done drawing. Calls such as renderer:draw-layout automatically activate the layout
before drawing on it.
Calls to renderer:activate and
renderer:deactivate can be nested and
the renderer will only be initialized and deinitialized once.
Passed: a <PangoRenderer>.
Cleans up after rendering operations on self.
See docs for renderer:activate.
Passed: a <PangoRenderer>.
Draw a squiggly line that approximately covers the given rectangle in the style of an underline used to indicate a spelling error.
The width of the underline is rounded to an integer number of up/down segments and the resulting rectangle is centered in the original rectangle.
This should be called while self is already active. Use
renderer:activate to activate a
renderer.
Passed: a <PangoRenderer>.
Passed: a 32-bit integer.
X coordinate of underline, in Pango units in user coordinate system
Passed: a 32-bit integer.
Y coordinate of underline, in Pango units in user coordinate system
Passed: a 32-bit integer.
width of underline, in Pango units in user coordinate system
Passed: a 32-bit integer.
height of underline, in Pango units in user coordinate system
Draws a single glyph with coordinates in device space.
Passed: a <PangoRenderer>.
Passed: a <PangoFont>.
Passed: an unsigned 32-bit integer.
the glyph index of a single glyph
Passed: a real number.
X coordinate of left edge of baseline of glyph
Passed: a real number.
Y coordinate of left edge of baseline of glyph
Draws the glyphs in glyph-item with the specified
<PangoRenderer>, embedding the text associated
with the glyphs in the output if the output format supports it.
This is useful for rendering text in PDF.
Note that this method does not handle attributes in glyph-item. If
you want colors, shapes and lines handled automatically according to
those attributes, you need to use renderer:draw-layout-line or renderer:draw-layout.
Note that text is the start of the text for layout, which is then
indexed by glyph_item->item->offset.
If text is #f, this simply calls renderer:draw-glyphs.
The default implementation of this method simply falls back to
renderer:draw-glyphs.
Passed: a <PangoRenderer>.
Passed: a string, or #f.
the UTF-8 text that glyph-item refers to
Passed: a <PangoGlyphItem>.
Passed: a 32-bit integer.
X position of left edge of baseline, in user space coordinates in Pango units
Passed: a 32-bit integer.
Y position of left edge of baseline, in user space coordinates in Pango units
Draws the glyphs in glyphs with the specified
<PangoRenderer>.
Passed: a <PangoRenderer>.
Passed: a <PangoFont>.
Passed: a <PangoGlyphString>.
Passed: a 32-bit integer.
X position of left edge of baseline, in user space coordinates in Pango units.
Passed: a 32-bit integer.
Y position of left edge of baseline, in user space coordinates in Pango units.
Draws layout with the specified
<PangoRenderer>.
This is equivalent to drawing the lines of the layout, at their respective positions relative to x, y.
Passed: a <PangoRenderer>.
Passed: a <PangoLayout>.
Passed: a 32-bit integer.
X position of left edge of baseline, in user space coordinates in Pango units.
Passed: a 32-bit integer.
Y position of left edge of baseline, in user space coordinates in Pango units.
Draws line with the specified
<PangoRenderer>.
This draws the glyph items that make up the line, as well as shapes, backgrounds and lines that are specified by the attributes of those items.
Passed: a <PangoRenderer>.
Passed: a <PangoLayoutLine>.
Passed: a 32-bit integer.
X position of left edge of baseline, in user space coordinates in Pango units.
Passed: a 32-bit integer.
Y position of left edge of baseline, in user space coordinates in Pango units.
Draws an axis-aligned rectangle in user space coordinates with the
specified <PangoRenderer>.
This should be called while self is already active. Use
renderer:activate to activate a
renderer.
Passed: a <PangoRenderer>.
Passed: a <PangoRenderPart>, or one of its
symbols.
type of object this rectangle is part of
Passed: a 32-bit integer.
X position at which to draw rectangle, in user space coordinates in Pango units
Passed: a 32-bit integer.
Y position at which to draw rectangle, in user space coordinates in Pango units
Passed: a 32-bit integer.
width of rectangle in Pango units
Passed: a 32-bit integer.
height of rectangle in Pango units
Draws a trapezoid with the parallel sides aligned with the X axis using
the given <PangoRenderer>; coordinates are in
device space.
Passed: a <PangoRenderer>.
Passed: a <PangoRenderPart>, or one of its
symbols.
type of object this trapezoid is part of
Passed: a real number.
Y coordinate of top of trapezoid
Passed: a real number.
X coordinate of left end of top of trapezoid
Passed: a real number.
X coordinate of right end of top of trapezoid
Passed: a real number.
Y coordinate of bottom of trapezoid
Passed: a real number.
X coordinate of left end of bottom of trapezoid
Passed: a real number.
X coordinate of right end of bottom of trapezoid
Gets the current alpha for the specified part.
Passed: a <PangoRenderer>.
Passed: a <PangoRenderPart>, or one of its
symbols.
the part to get the alpha for
Returned: an unsigned 16-bit integer.
the alpha for the specified part, or 0 if it hasn’t been set and should be inherited from the environment.
Gets the current rendering color for the specified part.
Passed: a <PangoRenderer>.
Passed: a <PangoRenderPart>, or one of its
symbols.
the part to get the color for
Returned: a <PangoColor>, or #f.
the color for the specified part, or #f if it hasn’t been set and
should be inherited from the environment.
Gets the layout currently being rendered using self.
Calling this function only makes sense from inside a subclass’s methods, like in its draw_shape vfunc, for example.
The returned layout should not be modified while still being rendered.
Passed: a <PangoRenderer>.
Returned: a <PangoLayout>, or #f.
the layout, or #f if no layout is being rendered using self
at this time.
Gets the layout line currently being rendered using self.
Calling this function only makes sense from inside a subclass’s methods, like in its draw_shape vfunc, for example.
The returned layout line should not be modified while still being rendered.
Passed: a <PangoRenderer>.
Returned: a <PangoLayoutLine>, or #f.
the layout line, or #f if no layout line is being rendered using
self at this time.
Gets the transformation matrix that will be applied when rendering.
See renderer:set-matrix.
Passed: a <PangoRenderer>.
Returned: a <PangoMatrix>, or #f.
the matrix, or #f if no matrix has been set (which is the same as
the identity matrix). The returned matrix is owned by Pango and must
not be modified or freed.
Informs Pango that the way that the rendering is done for part has changed.
This should be called if the rendering changes in a way that would
prevent multiple pieces being joined together into one drawing call. For
instance, if a subclass of <PangoRenderer> was to
add a stipple option for drawing underlines, it needs to call
pango_renderer_part_changed (render, PANGO_RENDER_PART_UNDERLINE);
When the stipple changes or underlines with different stipples might be
joined together. Pango automatically calls this for changes to colors.
(See renderer:set-color)
Passed: a <PangoRenderer>.
Passed: a <PangoRenderPart>, or one of its
symbols.
the part for which rendering has changed.
Sets the alpha for part of the rendering.
Note that the alpha may only be used if a color is specified for part as well.
Passed: a <PangoRenderer>.
Passed: a <PangoRenderPart>, or one of its
symbols.
the part to set the alpha for
Passed: an unsigned 16-bit integer.
an alpha value between 1 and 65536, or 0 to unset the alpha
Sets the color for part of the rendering.
Also see renderer:set-alpha.
Passed: a <PangoRenderer>.
Passed: a <PangoRenderPart>, or one of its
symbols.
the part to change the color of
Passed, or left out: a <PangoColor>, or #f.
the new color or #f to unset the current color
Sets the transformation matrix that will be applied when rendering.
Passed: a <PangoRenderer>.
Passed, or left out: a <PangoMatrix>, or #f.
a <PangoMatrix>, or #f to unset any existing
matrix (No matrix set is the same as setting the identity matrix.)
Do renderer-specific initialization before drawing
To override it in a new class, give register-type #:vfuncs
`((begin . ,procedure)). The procedure is called as (procedure
self).
Passed: the class whose implementation to call:
<PangoRenderer>, or a class that derives from it,
or its GType number.
Passed: a <PangoRenderer>.
Draw a squiggly line that approximately covers the given rectangle in the style of an underline used to indicate a spelling error.
The width of the underline is rounded to an integer number of up/down segments and the resulting rectangle is centered in the original rectangle.
This should be called while self is already active. Use
renderer:activate to activate a
renderer.
To override it in a new class, give register-type #:vfuncs
`((draw-error-underline . ,procedure)). The procedure is called as
(procedure self x y width height).
Passed: the class whose implementation to call:
<PangoRenderer>, or a class that derives from it,
or its GType number.
Passed: a <PangoRenderer>.
Passed: a 32-bit integer.
X coordinate of underline, in Pango units in user coordinate system
Passed: a 32-bit integer.
Y coordinate of underline, in Pango units in user coordinate system
Passed: a 32-bit integer.
width of underline, in Pango units in user coordinate system
Passed: a 32-bit integer.
height of underline, in Pango units in user coordinate system
Draws a single glyph with coordinates in device space.
To override it in a new class, give register-type #:vfuncs
`((draw-glyph . ,procedure)). The procedure is called as
(procedure self font glyph x y).
Passed: the class whose implementation to call:
<PangoRenderer>, or a class that derives from it,
or its GType number.
Passed: a <PangoRenderer>.
Passed: a <PangoFont>.
Passed: an unsigned 32-bit integer.
the glyph index of a single glyph
Passed: a real number.
X coordinate of left edge of baseline of glyph
Passed: a real number.
Y coordinate of left edge of baseline of glyph
Draws the glyphs in glyph-item with the specified
<PangoRenderer>, embedding the text associated
with the glyphs in the output if the output format supports it.
This is useful for rendering text in PDF.
Note that this method does not handle attributes in glyph-item. If
you want colors, shapes and lines handled automatically according to
those attributes, you need to use renderer:draw-layout-line or renderer:draw-layout.
Note that text is the start of the text for layout, which is then
indexed by glyph_item->item->offset.
If text is #f, this simply calls renderer:draw-glyphs.
The default implementation of this method simply falls back to
renderer:draw-glyphs.
To override it in a new class, give register-type #:vfuncs
`((draw-glyph-item . ,procedure)). The procedure is called as
(procedure self text glyph-item x y).
Passed: the class whose implementation to call:
<PangoRenderer>, or a class that derives from it,
or its GType number.
Passed: a <PangoRenderer>.
Passed: a string, or #f.
the UTF-8 text that glyph-item refers to
Passed: a <PangoGlyphItem>.
Passed: a 32-bit integer.
X position of left edge of baseline, in user space coordinates in Pango units
Passed: a 32-bit integer.
Y position of left edge of baseline, in user space coordinates in Pango units
Draws the glyphs in glyphs with the specified
<PangoRenderer>.
To override it in a new class, give register-type #:vfuncs
`((draw-glyphs . ,procedure)). The procedure is called as
(procedure self font glyphs x y).
Passed: the class whose implementation to call:
<PangoRenderer>, or a class that derives from it,
or its GType number.
Passed: a <PangoRenderer>.
Passed: a <PangoFont>.
Passed: a <PangoGlyphString>.
Passed: a 32-bit integer.
X position of left edge of baseline, in user space coordinates in Pango units.
Passed: a 32-bit integer.
Y position of left edge of baseline, in user space coordinates in Pango units.
Draws an axis-aligned rectangle in user space coordinates with the
specified <PangoRenderer>.
This should be called while self is already active. Use
renderer:activate to activate a
renderer.
To override it in a new class, give register-type #:vfuncs
`((draw-rectangle . ,procedure)). The procedure is called as
(procedure self part x y width height).
Passed: the class whose implementation to call:
<PangoRenderer>, or a class that derives from it,
or its GType number.
Passed: a <PangoRenderer>.
Passed: a <PangoRenderPart>, or one of its
symbols.
type of object this rectangle is part of
Passed: a 32-bit integer.
X position at which to draw rectangle, in user space coordinates in Pango units
Passed: a 32-bit integer.
Y position at which to draw rectangle, in user space coordinates in Pango units
Passed: a 32-bit integer.
width of rectangle in Pango units
Passed: a 32-bit integer.
height of rectangle in Pango units
Draws a trapezoid with the parallel sides aligned with the X axis using
the given <PangoRenderer>; coordinates are in
device space.
To override it in a new class, give register-type #:vfuncs
`((draw-trapezoid . ,procedure)). The procedure is called as
(procedure self part y1- x11 x21 y2 x12 x22).
Passed: the class whose implementation to call:
<PangoRenderer>, or a class that derives from it,
or its GType number.
Passed: a <PangoRenderer>.
Passed: a <PangoRenderPart>, or one of its
symbols.
type of object this trapezoid is part of
Passed: a real number.
Y coordinate of top of trapezoid
Passed: a real number.
X coordinate of left end of top of trapezoid
Passed: a real number.
X coordinate of right end of top of trapezoid
Passed: a real number.
Y coordinate of bottom of trapezoid
Passed: a real number.
X coordinate of left end of bottom of trapezoid
Passed: a real number.
X coordinate of right end of bottom of trapezoid
Do renderer-specific cleanup after drawing
To override it in a new class, give register-type #:vfuncs
`((end . ,procedure)). The procedure is called as (procedure
self).
Passed: the class whose implementation to call:
<PangoRenderer>, or a class that derives from it,
or its GType number.
Passed: a <PangoRenderer>.
Informs Pango that the way that the rendering is done for part has changed.
This should be called if the rendering changes in a way that would
prevent multiple pieces being joined together into one drawing call. For
instance, if a subclass of <PangoRenderer> was to
add a stipple option for drawing underlines, it needs to call
pango_renderer_part_changed (render, PANGO_RENDER_PART_UNDERLINE);
When the stipple changes or underlines with different stipples might be
joined together. Pango automatically calls this for changes to colors.
(See renderer:set-color)
To override it in a new class, give register-type #:vfuncs
`((part-changed . ,procedure)). The procedure is called as
(procedure self part).
Passed: the class whose implementation to call:
<PangoRenderer>, or a class that derives from it,
or its GType number.
Passed: a <PangoRenderer>.
Passed: a <PangoRenderPart>, or one of its
symbols.
the part for which rendering has changed.
updates the renderer for a new run
To override it in a new class, give register-type #:vfuncs
`((prepare-run . ,procedure)). The procedure is called as
(procedure self run).
Passed: the class whose implementation to call:
<PangoRenderer>, or a class that derives from it,
or its GType number.
Passed: a <PangoRenderer>.
Passed: a <PangoGlyphItem>.