Rendering driver base class
<pango-renderer>
is a base class that contains the necessary logic for
rendering a <pango-layout>
or <pango-layout-line>
. By subclassing
<pango-renderer>
and overriding operations such as draw-glyphs and
draw-rectangle, renderers for particular font backends and destinations
can be created.
<pango-renderer>
) (layout <pango-layout>
) (x int
) (y int
)Draws layout with the specified
<pango-renderer>
.
- renderer
- a
<pango-renderer>
- layout
- a
<pango-layout>
- x
- X position of left edge of baseline, in user space coordinates in Pango units.
- y
- Y position of left edge of baseline, in user space coordinates in Pango units.
Since 1.8
<pango-renderer>
) (line <pango-layout-line>
) (x int
) (y int
)Draws line with the specified
<pango-renderer>
.
- renderer
- a
<pango-renderer>
- line
- a
<pango-layout-line>
- x
- X position of left edge of baseline, in user space coordinates in Pango units.
- y
- Y position of left edge of baseline, in user space coordinates in Pango units.
Since 1.8
<pango-renderer>
) (font <pango-font>
) (glyphs <pango-glyph-string>
) (x int
) (y int
)Draws the glyphs in glyphs with the specified
<pango-renderer>
.
- renderer
- a
<pango-renderer>
- font
- a
<pango-font>
- glyphs
- a
<pango-glyph-string>
- x
- X position of left edge of baseline, in user space coordinates in Pango units.
- y
- Y position of left edge of baseline, in user space coordinates in Pango units.
Since 1.8
<pango-renderer>
) (part <pango-render-part>
) (x int
) (y int
) (width int
) (height int
)Draws an axis-aligned rectangle in user space coordinates with the specified
<pango-renderer>
.This should be called while renderer is already active. Use
pango-renderer-activate
to activate a renderer.
- renderer
- a
<pango-renderer>
- part
- type of object this rectangle is part of
- x
- X position at which to draw rectangle, in user space coordinates in Pango units
- y
- Y position at which to draw rectangle, in user space coordinates in Pango units
- width
- width of rectangle in Pango units in user space coordinates
- height
- height of rectangle in Pango units in user space coordinates
Since 1.8
<pango-renderer>
) (x int
) (y int
) (width int
) (height int
)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 renderer is already active. Use
pango-renderer-activate
to activate a renderer.
- renderer
- a
<pango-renderer>
- x
- X coordinate of underline, in Pango units in user coordinate system
- y
- Y coordinate of underline, in Pango units in user coordinate system
- width
- width of underline, in Pango units in user coordinate system
- height
- height of underline, in Pango units in user coordinate system
Since 1.8
<pango-renderer>
) (part <pango-render-part>
) (y1_ double
) (x11 double
) (x21 double
) (y2 double
) (x12 double
) (x22 double
)Draws a trapezoid with the parallel sides aligned with the X axis using the given
<pango-renderer>
; coordinates are in device space.
- renderer
- a
<pango-renderer>
- part
- type of object this trapezoid is part of
- y1
- Y coordinate of top of trapezoid
- x11
- X coordinate of left end of top of trapezoid
- x21
- X coordinate of right end of top of trapezoid
- y2
- Y coordinate of bottom of trapezoid
- x12
- X coordinate of left end of bottom of trapezoid
- x22
- X coordinate of right end of bottom of trapezoid
Since 1.8
<pango-renderer>
) (font <pango-font>
) (glyph unsigned-int32
) (x double
) (y double
)Draws a single glyph with coordinates in device space.
- renderer
- a
<pango-renderer>
- font
- a
<pango-font>
- glyph
- the glyph index of a single glyph
- x
- X coordinate of left edge of baseline of glyph
- y
- Y coordinate of left edge of baseline of glyph
Since 1.8
<pango-renderer>
)Does initial setup before rendering operations on renderer.
pango-renderer-deactivate
should be called when done drawing. Calls such aspango-renderer-draw-layout
automatically activate the layout before drawing on it. Calls topango-renderer-activate
andpango-renderer-deactivate
can be nested and the renderer will only be initialized and deinitialized once.
- renderer
- a
<pango-renderer>
Since 1.8
<pango-renderer>
)Cleans up after rendering operations on renderer. See docs for
pango-renderer-activate
.
- renderer
- a
<pango-renderer>
Since 1.8
<pango-renderer>
) (part <pango-render-part>
)Informs Pango that the way that the rendering is done for part has changed in a way that would prevent multiple pieces being joined together into one drawing call. For instance, if a subclass of
<pango-renderer>
was to add a stipple option for drawing underlines, it needs to callpango_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
pango-renderer-set-color
)
- renderer
- a
<pango-renderer>
- part
- the part for which rendering has changed.
Since 1.8
<pango-renderer>
) (part <pango-render-part>
) (color <pango-color>
)Sets the color for part of the rendering.
- renderer
- a
<pango-renderer>
- part
- the part to change the color of
- color
- the new color or ‘
#f
’ to unset the current colorSince 1.8
<pango-renderer>
) (part <pango-render-part>
) ⇒ (ret <pango-color>
)Gets the current rendering color for the specified part.
- renderer
- a
<pango-renderer>
- part
- the part to get the color for
- ret
- the color for the specified part, or ‘
#f
’ if it hasn't been set and should be inherited from the environment.Since 1.8
<pango-renderer>
) (matrix <pango-matrix>
)Sets the transformation matrix that will be applied when rendering.
- renderer
- a
<pango-renderer>
- matrix
- a
<pango-matrix>
, or ‘#f
’ to unset any existing matrix. (No matrix set is the same as setting the identity matrix.)Since 1.8
<pango-renderer>
) ⇒ (ret <pango-matrix>
)Gets the transformation matrix that will be applied when rendering. See
pango-renderer-set-matrix
.
- renderer
- a
<pango-renderer>
- ret
- 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.Since 1.8