pango.Renderer — a base class for pango rendering (new in PyGTK 2.8)
class pango.Renderer(gobject.GObject): |
pango.Renderer is a base class that contains the necessary logic for rendering a pango.Layout or pango.LayoutLine. By subclassing pango.Renderer and overriding operations such as draw_glyphs() and draw_rectangle(), renderers for particular font backends and destinations can be created.
|
layout : | a pango.Layout |
x : | the x position of left edge of baseline, in user space coordinates in Pango units. |
y : | the y position of left edge of baseline, in user space coordinates in Pango units. |
This method is available in PyGTK 2.8 and above.
The draw_layout() method draws the pango.Layout s[ecified by layout at the position specified by x and y.
|
line : | a pango.LayoutLine |
x : | the x position of left edge of baseline, in user space coordinates in Pango units. |
y : | the y position of left edge of baseline, in user space coordinates in Pango units. |
This method is available in PyGTK 2.8 and above.
The draw_layout_line() method draws the pango.LayoutLine specified by line at the position specified by x and y.
|
font : | a pango.Font |
glyphs : | a pango.GlyphString |
x : | the x position of left edge of baseline, in user space coordinates in Pango units. |
y : | the y position of left edge of baseline, in user space coordinates in Pango units. |
This method is available in PyGTK 2.8 and above.
The draw_glyphs() method draws the pango.GlyphString specified by glyphs using the pango.Font specified by font at the position specified by x and y.
|
part : | the part where the rectangle is to be rendered |
x : | the x position at which to draw rectangle, in user space coordinates in Pango units |
y : | the y position at which to draw rectangle, in user space coordinates in Pango units |
width : | the width of rectangle in Pango units in user space coordinates |
height : | the height of rectangle in Pango units in user space coordinates |
This method is available in PyGTK 2.8 and above.
The draw_rectangle() method draws an axis-aligned rectangle with the size specified by width and height at the position specified by x and y, all in user space coordinates. The rectangle will be drawn in the rendering part (see the Pango Render Part Constants) specified by part.
|
x : | the X coordinate of the underline, in Pango units in the user coordinate system |
y : | the Y coordinate of the underline, in Pango units in the user coordinate system |
width : | the width of the underline, in Pango units in the user coordinate system |
height : | the height of the underline, in Pango units in the user coordinate system |
This method is available in PyGTK 2.8 and above.
The draw_error_underline() method draws a squiggly line that approximately covers the rectangle specified by x, y, width and height 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).
|
part : | where the trapezoid is to be rendered |
y1_ : | the Y coordinate of the top of the trapezoid |
x11 : | the X coordinate of the left end of the top of the trapezoid |
x21 : | the X coordinate of the right end of the top of the trapezoid |
y2 : | the Y coordinate of the bottom of the trapezoid |
x12 : | the X coordinate of the left end of the bottom of the trapezoid |
x22 : | the X coordinate of the left end of the bottom of the trapezoid |
This method is available in PyGTK 2.8 and above.
The draw_trapezoid() method draws a trapezoid with the parallel sides aligned with the X axis using the coordinates specified by y1_, x11, x21, y2, x12, x22. The coordinates are in device space. The trapezoid is rendered in the part specified by part which must be one of the Pango Render Part Constants.
|
This method is available in PyGTK 2.8 and above.
The activate() method does initial setup before performing the rendering operations on renderer. The deactivate() method should be called when drawing is complete. Calls to the draw_layout() method automatically activate the layout before drawing on it. Calls to the activate() and deactivate() methods can be nested and the renderer will only be initialized and deinitialized once.
|
This method is available in PyGTK 2.8 and above.
The deactivate() method cleans up after rendering operations are completed. See the activate() method for more information.
|
part : | the part that has its rendering changed. |
This method is available in PyGTK 2.8 and above.
The part_changed() method informs Pango that the way that the renderering is done for the part specified by part has changed in a way that would prevent multiple pieces being joined together into one drawing call. part must be one of the Pango Render Part Constants. For instance, if a subclass of pango.Renderer was to add a stipple option for drawing underlines, it needs to call:
renderer.part_changed(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 the set_color() method for more information).
|
part : | the part to change the color of |
color : | a pango.Color |
This method is available in PyGTK 2.8 and above.
The set_color() method sets the pango.Color specified by color as the color for the part specified by part. part must be one of the Pango Render Part Constants.
|
part : | a part |
Returns :, :, | a pango.Color or None |
This method is available in PyGTK 2.8 and above.
The get_color() method returns the current rendering pango.Color for the part specified by part. part must be one of the Pango Render Part Constants. If None is returned, the color has not been set and should be inherited from the environment.