Class: Pango::Renderer
- Inherits:
-
Object
- Object
- Pango::Renderer
- Defined in:
- (unknown)
Overview
Class structure for Pango::Renderer.
The following vfuncs take user space coordinates in Pango units and have default implementations:
-
draw_glyphs
-
draw_rectangle
-
draw_error_underline
-
draw_shape
-
draw_glyph_item
The default draw_shape implementation draws nothing.
The following vfuncs take device space coordinates as doubles and must be implemented:
-
draw_trapezoid
-
draw_glyph
Instance Method Summary collapse
-
#activate ⇒ nil
Does initial setup before rendering operations on renderer.
-
#deactivate ⇒ nil
Cleans up after rendering operations on renderer.
-
#draw_error_underline(x, y, width, height) ⇒ nil
Draw a squiggly line that approximately covers the given rectangle in the style of an underline used to indicate a spelling error.
-
#draw_glyph(font, glyph, x, y) ⇒ nil
Draws a single glyph with coordinates in device space.
-
#draw_glyph_item(text, glyph_item, x, y) ⇒ nil
Draws the glyphs in glyph_item with the specified Pango::Renderer, embedding the text associated with the glyphs in the output if the output format supports it (PDF for example).
-
#draw_glyphs(font, glyphs, x, y) ⇒ nil
Draws the glyphs in glyphs with the specified Pango::Renderer.
-
#draw_layout(layout, x, y) ⇒ nil
Draws layout with the specified Pango::Renderer.
-
#draw_layout_line(line, x, y) ⇒ nil
Draws line with the specified Pango::Renderer.
-
#draw_rectangle(part, x, y, width, height) ⇒ nil
Draws an axis-aligned rectangle in user space coordinates with the specified Pango::Renderer.
-
#draw_trapezoid(part, y1_, x11, x21, y2, x12, x22) ⇒ nil
Draws a trapezoid with the parallel sides aligned with the X axis using the given Pango::Renderer; coordinates are in device space.
-
#get_alpha(part) ⇒ Integer
Gets the current alpha for the specified part.
-
#get_color(part) ⇒ Pango::Color
Gets the current rendering color for the specified part.
-
#layout ⇒ Pango::Layout
Gets the layout currently being rendered using renderer.
-
#layout_line ⇒ Pango::LayoutLine
Gets the layout line currently being rendered using renderer.
-
#matrix ⇒ Pango::Matrix
Gets the transformation matrix that will be applied when rendering.
-
#matrix=(matrix) ⇒ nil
Sets the transformation matrix that will be applied when rendering.
-
#part_changed(part) ⇒ nil
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.
-
#set_alpha(part, alpha) ⇒ nil
Sets the alpha for part of the rendering.
-
#set_color(part, color) ⇒ nil
Sets the color for part of the rendering.
Instance Method Details
#activate ⇒ nil
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.
#deactivate ⇒ nil
Cleans up after rendering operations on renderer. See docs for pango_renderer_activate().
#draw_error_underline(x, y, width, height) ⇒ nil
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.
#draw_glyph(font, glyph, x, y) ⇒ nil
Draws a single glyph with coordinates in device space.
#draw_glyph_item(text, glyph_item, x, y) ⇒ nil
Draws the glyphs in glyph_item with the specified Pango::Renderer, embedding the text associated with the glyphs in the output if the output format supports it (PDF for example).
Note that text is the start of the text for layout, which is then indexed by <literal>glyph_item->item->offset</literal>.
If text is nil, this simply calls pango_renderer_draw_glyphs().
The default implementation of this method simply falls back to pango_renderer_draw_glyphs().
#draw_glyphs(font, glyphs, x, y) ⇒ nil
Draws the glyphs in glyphs with the specified Pango::Renderer.
#draw_layout(layout, x, y) ⇒ nil
Draws layout with the specified Pango::Renderer.
#draw_layout_line(line, x, y) ⇒ nil
Draws line with the specified Pango::Renderer.
#draw_rectangle(part, x, y, width, height) ⇒ nil
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.
#draw_trapezoid(part, y1_, x11, x21, y2, x12, x22) ⇒ nil
Draws a trapezoid with the parallel sides aligned with the X axis using the given Pango::Renderer; coordinates are in device space.
#get_alpha(part) ⇒ Integer
Gets the current alpha for the specified part.
#get_color(part) ⇒ Pango::Color
Gets the current rendering color for the specified part.
#layout ⇒ Pango::Layout
Gets the layout currently being rendered using renderer. 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.
#layout_line ⇒ Pango::LayoutLine
Gets the layout line currently being rendered using renderer. 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.
#matrix ⇒ Pango::Matrix
Gets the transformation matrix that will be applied when rendering. See pango_renderer_set_matrix().
#matrix=(matrix) ⇒ nil
Sets the transformation matrix that will be applied when rendering.
#part_changed(part) ⇒ nil
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
<informalexample><programlisting> pango_renderer_part_changed (render, PANGO_RENDER_PART_UNDERLINE); </programlisting></informalexample>
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())
#set_alpha(part, alpha) ⇒ nil
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.
#set_color(part, color) ⇒ nil
Sets the color for part of the rendering. Also see pango_renderer_set_alpha().