Next: , Previous: Rendering, Up: Top


7 PangoRenderer

Rendering driver base class

7.1 Overview

<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.

7.2 Usage

— Class: <pango-renderer>

Derives from <gobject>.

This class defines no direct slots.

— Function: pango-renderer-draw-layout (self <pango-renderer>) (layout <pango-layout>) (int) (int)
— Method: draw-layout

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

— Function: pango-renderer-draw-layout-line (self <pango-renderer>) (line <pango-layout-line>) (int) (int)
— Method: draw-layout-line

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

— Function: pango-renderer-draw-glyphs (self <pango-renderer>) (font <pango-font>) (glyphs <pango-glyph-string>) (int) (int)
— Method: draw-glyphs

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

— Function: pango-renderer-draw-rectangle (self <pango-renderer>) (part <pango-render-part>) (int) (int) (width int) (height int)
— Method: draw-rectangle

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

— Function: pango-renderer-draw-error-underline (self <pango-renderer>) (int) (int) (width int) (height int)
— Method: draw-error-underline

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

— Function: pango-renderer-draw-trapezoid (self <pango-renderer>) (part <pango-render-part>) (y1_ double) (x11 double) (x21 double) (y2 double) (x12 double) (x22 double)
— Method: draw-trapezoid

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

— Function: pango-renderer-draw-glyph (self <pango-renderer>) (font <pango-font>) (glyph unsigned-int32) (double) (double)
— Method: draw-glyph

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

— Function: pango-renderer-activate (self <pango-renderer>)
— Method: activate

Does initial setup before rendering operations on renderer. pango-renderer-deactivate should be called when done drawing. Calls such as pango-renderer-draw-layout automatically activate the layout before drawing on it. Calls to pango-renderer-activate and pango-renderer-deactivate can be nested and the renderer will only be initialized and deinitialized once.

renderer
a <pango-renderer>

Since 1.8

— Function: pango-renderer-deactivate (self <pango-renderer>)
— Method: deactivate

Cleans up after rendering operations on renderer. See docs for pango-renderer-activate.

renderer
a <pango-renderer>

Since 1.8

— Function: pango-renderer-part-changed (self <pango-renderer>) (part <pango-render-part>)
— Method: part-changed

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 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 pango-renderer-set-color)

renderer
a <pango-renderer>
part
the part for which rendering has changed.

Since 1.8

— Function: pango-renderer-set-color (self <pango-renderer>) (part <pango-render-part>) (color <pango-color>)
— Method: set-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 color

Since 1.8

— Function: pango-renderer-get-color (self <pango-renderer>) (part <pango-render-part>) ⇒  (ret <pango-color>)
— Method: get-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

— Function: pango-renderer-set-matrix (self <pango-renderer>) (matrix <pango-matrix>)
— Method: set-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

— Function: pango-renderer-get-matrix (self <pango-renderer>) ⇒  (ret <pango-matrix>)
— Method: get-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