SynopsisPangoRenderer; enum PangoRenderPart; #define PANGO_TYPE_RENDER_PART PangoRendererClass; void pango_renderer_draw_layout (PangoRenderer *renderer, PangoLayout *layout, int x, int y); void pango_renderer_draw_layout_line (PangoRenderer *renderer, PangoLayoutLine *line, int x, int y); void pango_renderer_draw_glyphs (PangoRenderer *renderer, PangoFont *font, PangoGlyphString *glyphs, int x, int y); void pango_renderer_draw_glyph_item (PangoRenderer *renderer, const char *text, PangoGlyphItem *glyph_item, int x, int y); void pango_renderer_draw_rectangle (PangoRenderer *renderer, PangoRenderPart part, int x, int y, int width, int height); void pango_renderer_draw_error_underline (PangoRenderer *renderer, int x, int y, int width, int height); void pango_renderer_draw_trapezoid (PangoRenderer *renderer, PangoRenderPart part, double y1_, double x11, double x21, double y2, double x12, double x22); void pango_renderer_draw_glyph (PangoRenderer *renderer, PangoFont *font, PangoGlyph glyph, double x, double y); void pango_renderer_activate (PangoRenderer *renderer); void pango_renderer_deactivate (PangoRenderer *renderer); void pango_renderer_part_changed (PangoRenderer *renderer, PangoRenderPart part); void pango_renderer_set_color (PangoRenderer *renderer, PangoRenderPart part, const PangoColor *color); PangoColor* pango_renderer_get_color (PangoRenderer *renderer, PangoRenderPart part); void pango_renderer_set_matrix (PangoRenderer *renderer, const PangoMatrix *matrix); const PangoMatrix* pango_renderer_get_matrix (PangoRenderer *renderer); PangoLayout* pango_renderer_get_layout (PangoRenderer *renderer); PangoLayoutLine* pango_renderer_get_layout_line (PangoRenderer *renderer); Description
PangoRenderer is a base class that contains the necessary logic for
rendering a PangoLayout or PangoLayoutLine. By subclassing
PangoRenderer and overriding operations such as DetailsPangoRenderertypedef struct { PangoMatrix *matrix; /* May be NULL */ } PangoRenderer; PangoRenderer is a base class for objects that are used to render Pango objects such as PangoGlyphString and PangoLayout.
Since 1.8 enum PangoRenderParttypedef enum { PANGO_RENDER_PART_FOREGROUND, PANGO_RENDER_PART_BACKGROUND, PANGO_RENDER_PART_UNDERLINE, PANGO_RENDER_PART_STRIKETHROUGH } PangoRenderPart; PangoRenderPart defines different items to render for such purposes as setting colors.
Since 1.8 PANGO_TYPE_RENDER_PART#define PANGO_TYPE_RENDER_PART (pango_render_part_get_type()) The GObject type for PangoRenderPart. PangoRendererClasstypedef struct { /* All of the following have default implementations * and take as coordinates user coordinates in Pango units */ void (*draw_glyphs) (PangoRenderer *renderer, PangoFont *font, PangoGlyphString *glyphs, int x, int y); void (*draw_rectangle) (PangoRenderer *renderer, PangoRenderPart part, int x, int y, int width, int height); void (*draw_error_underline) (PangoRenderer *renderer, int x, int y, int width, int height); /* Nothing is drawn for shaped glyphs unless this is implemented */ void (*draw_shape) (PangoRenderer *renderer, PangoAttrShape *attr, int x, int y); /* These two must be implemented and take coordinates in * device space as doubles. */ void (*draw_trapezoid) (PangoRenderer *renderer, PangoRenderPart part, double y1_, double x11, double x21, double y2, double x12, double x22); void (*draw_glyph) (PangoRenderer *renderer, PangoFont *font, PangoGlyph glyph, double x, double y); /* Notification of change in rendering attributes */ void (*part_changed) (PangoRenderer *renderer, PangoRenderPart part); /* Paired around drawing operations */ void (*begin) (PangoRenderer *renderer); void (*end) (PangoRenderer *renderer); /* Hooks into the details of layout rendering */ void (*prepare_run) (PangoRenderer *renderer, PangoLayoutRun *run); /* All of the following have default implementations * and take as coordinates user coordinates in Pango units */ void (*draw_glyph_item) (PangoRenderer *renderer, const char *text, PangoGlyphItem *glyph_item, int x, int y); } PangoRendererClass; Class structure for PangoRenderer.
Since 1.8 pango_renderer_draw_layout ()void pango_renderer_draw_layout (PangoRenderer *renderer, PangoLayout *layout, int x, int y);
Draws
Since 1.8 pango_renderer_draw_layout_line ()void pango_renderer_draw_layout_line (PangoRenderer *renderer, PangoLayoutLine *line, int x, int y);
Draws
Since 1.8 pango_renderer_draw_glyphs ()void pango_renderer_draw_glyphs (PangoRenderer *renderer, PangoFont *font, PangoGlyphString *glyphs, int x, int y);
Draws the glyphs in
Since 1.8 pango_renderer_draw_glyph_item ()void pango_renderer_draw_glyph_item (PangoRenderer *renderer, const char *text, PangoGlyphItem *glyph_item, int x, int y);
Draws the glyphs in
Note that
The default implementation of this method simply falls back to
Since 1.22 pango_renderer_draw_rectangle ()void pango_renderer_draw_rectangle (PangoRenderer *renderer, PangoRenderPart part, int x, int y, int width, int height); Draws an axis-aligned rectangle in user space coordinates with the specified PangoRenderer.
This should be called while
Since 1.8 pango_renderer_draw_error_underline ()void pango_renderer_draw_error_underline (PangoRenderer *renderer, int x, int y, int width, int height); 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
Since 1.8 pango_renderer_draw_trapezoid ()void pango_renderer_draw_trapezoid (PangoRenderer *renderer, PangoRenderPart part, double y1_, double x11, double x21, double y2, double x12, double x22); Draws a trapezoid with the parallel sides aligned with the X axis using the given PangoRenderer; coordinates are in device space.
Since 1.8 pango_renderer_draw_glyph ()void pango_renderer_draw_glyph (PangoRenderer *renderer, PangoFont *font, PangoGlyph glyph, double x, double y); Draws a single glyph with coordinates in device space.
Since 1.8 pango_renderer_activate ()void pango_renderer_activate (PangoRenderer *renderer);
Does initial setup before rendering operations on
Since 1.8 pango_renderer_deactivate ()void pango_renderer_deactivate (PangoRenderer *renderer);
Cleans up after rendering operations on
Since 1.8 pango_renderer_part_changed ()void pango_renderer_part_changed (PangoRenderer *renderer, PangoRenderPart part);
Informs Pango that the way that the rendering is done
for
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
Since 1.8 pango_renderer_set_color ()void pango_renderer_set_color (PangoRenderer *renderer, PangoRenderPart part, const PangoColor *color); Sets the color for part of the rendering.
Since 1.8 pango_renderer_get_color ()PangoColor* pango_renderer_get_color (PangoRenderer *renderer, PangoRenderPart part); Gets the current rendering color for the specified part.
Since 1.8 pango_renderer_set_matrix ()void pango_renderer_set_matrix (PangoRenderer *renderer, const PangoMatrix *matrix); Sets the transformation matrix that will be applied when rendering.
Since 1.8 pango_renderer_get_matrix ()const PangoMatrix* pango_renderer_get_matrix (PangoRenderer *renderer);
Gets the transformation matrix that will be applied when
rendering. See
Since 1.8 pango_renderer_get_layout ()PangoLayout* pango_renderer_get_layout (PangoRenderer *renderer);
Gets the layout currently being rendered using The returned layout should not be modified while still being rendered.
Since 1.20 pango_renderer_get_layout_line ()PangoLayoutLine* pango_renderer_get_layout_line (PangoRenderer *renderer);
Gets the layout line currently being rendered using The returned layout line should not be modified while still being rendered.
Since 1.20 |