1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>pango.Renderer</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="pango-class-reference.html" title="The pango Class Reference"><link rel="prev" href="class-pangolayoutline.html" title="pango.LayoutLine"><link rel="next" href="class-pangotabarray.html" title="pango.TabArray"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">pango.Renderer</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-pangolayoutline.html">Prev</a> </td><th width="60%" align="center">The pango Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-pangotabarray.html">Next</a></td></tr></table><hr></div><div class="refentry" title="pango.Renderer"><a name="class-pangorenderer"></a><div class="titlepage"></div><div class="refnamediv"><h2>pango.Renderer</h2><p>pango.Renderer — a base class for pango rendering (new in
PyGTK 2.8)</p></div><div class="refsect1" title="Synopsis"><a name="id3334416"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">pango.Renderer</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>):
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangorenderer.html#method-pangorenderer--draw-layout" title="pango.Renderer.draw_layout">draw_layout</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>layout</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangorenderer.html#method-pangorenderer--draw-layout-line" title="pango.Renderer.draw_layout_line">draw_layout_line</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>line</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangorenderer.html#method-pangorenderer--draw-glyphs" title="pango.Renderer.draw_glyphs">draw_glyphs</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>font</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>glyphs</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangorenderer.html#method-pangorenderer--draw-rectangle" title="pango.Renderer.draw_rectangle">draw_rectangle</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>part</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangorenderer.html#method-pangorenderer--draw-error-underline" title="pango.Renderer.draw_error_underline">draw_error_underline</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangorenderer.html#method-pangorenderer--draw-trapezoid" title="pango.Renderer.draw_trapezoid">draw_trapezoid</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>part</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y1_</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x11</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x21</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y2</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x12</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x22</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangorenderer.html#method-pangorenderer--activate" title="pango.Renderer.activate">activate</a></span>()</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangorenderer.html#method-pangorenderer--deactivate" title="pango.Renderer.deactivate">deactivate</a></span>()</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangorenderer.html#method-pangorenderer--part-changed" title="pango.Renderer.part_changed">part_changed</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>part</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangorenderer.html#method-pangorenderer--set-color" title="pango.Renderer.set_color">set_color</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>part</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>color</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangorenderer.html#method-pangorenderer--get-color" title="pango.Renderer.get_color">get_color</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>part</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id3209166"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-pangorenderer.html" title="pango.Renderer">pango.Renderer</a>
</pre></div><div class="refsect1" title="Description"><a name="id2918058"></a><h2>Description</h2><p><a class="link" href="class-pangorenderer.html" title="pango.Renderer"><code class="classname">pango.Renderer</code></a>
is a base class that contains the necessary logic for rendering a <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a> or
<a class="link" href="class-pangolayoutline.html" title="pango.LayoutLine"><code class="classname">pango.LayoutLine</code></a>. By
subclassing <a class="link" href="class-pangorenderer.html" title="pango.Renderer"><code class="classname">pango.Renderer</code></a>
and overriding operations such as <a class="link" href="class-pangorenderer.html#method-pangorenderer--draw-glyphs" title="pango.Renderer.draw_glyphs"><code class="methodname">draw_glyphs</code>()</a>
and <a class="link" href="class-pangorenderer.html#method-pangorenderer--draw-rectangle" title="pango.Renderer.draw_rectangle"><code class="methodname">draw_rectangle</code>()</a>,
renderers for particular font backends and destinations can be
created.</p></div><div class="refsect1" title="Methods"><a name="id3460039"></a><h2>Methods</h2><div class="refsect2" title="pango.Renderer.draw_layout"><a name="method-pangorenderer--draw-layout"></a><h3>pango.Renderer.draw_layout</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">draw_layout</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>layout</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>layout</code></strong> :</span></p></td><td>a <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>x</code></strong> :</span></p></td><td>the x position of left edge of baseline,
in user space coordinates in Pango units.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td>the y position of left edge of baseline,
in user space coordinates in Pango units.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">draw_layout</code>() method draws the
<a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a>
s[ecified by <em class="parameter"><code>layout</code></em> at the position specified by
<em class="parameter"><code>x</code></em> and <em class="parameter"><code>y</code></em>.</p></div><div class="refsect2" title="pango.Renderer.draw_layout_line"><a name="method-pangorenderer--draw-layout-line"></a><h3>pango.Renderer.draw_layout_line</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">draw_layout_line</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>line</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>line</code></strong> :</span></p></td><td>a <a class="link" href="class-pangolayoutline.html" title="pango.LayoutLine"><code class="classname">pango.LayoutLine</code></a></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>x</code></strong> :</span></p></td><td>the x position of left edge of baseline,
in user space coordinates in Pango units.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td>the y position of left edge of baseline,
in user space coordinates in Pango units.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">draw_layout_line</code>() method draws the
<a class="link" href="class-pangolayoutline.html" title="pango.LayoutLine"><code class="classname">pango.LayoutLine</code></a>
specified by <em class="parameter"><code>line</code></em> at the position specified by
<em class="parameter"><code>x</code></em> and <em class="parameter"><code>y</code></em>.</p></div><div class="refsect2" title="pango.Renderer.draw_glyphs"><a name="method-pangorenderer--draw-glyphs"></a><h3>pango.Renderer.draw_glyphs</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">draw_glyphs</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>font</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>glyphs</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>font</code></strong> :</span></p></td><td>a <a class="link" href="class-pangofont.html" title="pango.Font"><code class="classname">pango.Font</code></a></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>glyphs</code></strong> :</span></p></td><td>a <a class="link" href="class-pangoglyphstring.html" title="pango.GlyphString"><code class="classname">pango.GlyphString</code></a></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>x</code></strong> :</span></p></td><td>the x position of left edge of baseline,
in user space coordinates in Pango units.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td>the y position of left edge of baseline,
in user space coordinates in Pango units.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">draw_glyphs</code>() method draws the
<a class="link" href="class-pangoglyphstring.html" title="pango.GlyphString"><code class="classname">pango.GlyphString</code></a>
specified by <em class="parameter"><code>glyphs</code></em> using the <a class="link" href="class-pangofont.html" title="pango.Font"><code class="classname">pango.Font</code></a> specified
by <em class="parameter"><code>font</code></em> at the position specified by
<em class="parameter"><code>x</code></em> and <em class="parameter"><code>y</code></em>.</p></div><div class="refsect2" title="pango.Renderer.draw_rectangle"><a name="method-pangorenderer--draw-rectangle"></a><h3>pango.Renderer.draw_rectangle</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">draw_rectangle</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>part</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>part</code></strong> :</span></p></td><td>the part where the rectangle is to be
rendered</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>x</code></strong> :</span></p></td><td>the x position at which to draw rectangle,
in user space coordinates in Pango units</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td>the y position at which to draw rectangle,
in user space coordinates in Pango units</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>width</code></strong> :</span></p></td><td>the width of rectangle in Pango units
in user space coordinates</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>height</code></strong> :</span></p></td><td>the height of rectangle in Pango units
in user space coordinates</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">draw_rectangle</code>() method draws an
axis-aligned rectangle with the size specified by
<em class="parameter"><code>width</code></em> and <em class="parameter"><code>height</code></em> at the
position specified by <em class="parameter"><code>x</code></em> and <em class="parameter"><code>y</code></em>,
all in user space coordinates. The rectangle will be drawn in the rendering
part (see the <a class="xref" href="pango-constants.html#pango-render-part-constants" title="Pango Render Part Constants">Pango Render Part Constants</a>) specified by
<em class="parameter"><code>part</code></em>.</p></div><div class="refsect2" title="pango.Renderer.draw_error_underline"><a name="method-pangorenderer--draw-error-underline"></a><h3>pango.Renderer.draw_error_underline</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">draw_error_underline</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>x</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>height</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>x</code></strong> :</span></p></td><td>the X coordinate of the underline, in Pango units
in the user coordinate system</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td>the Y coordinate of the underline, in Pango units
in the user coordinate system</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>width</code></strong> :</span></p></td><td>the width of the underline, in Pango units
in the user coordinate system</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>height</code></strong> :</span></p></td><td>the height of the underline, in Pango units
in the user coordinate system</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">draw_error_underline</code>() method draws a
squiggly line that approximately covers the rectangle specified by
<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>,
<em class="parameter"><code>width</code></em> and <em class="parameter"><code>height</code></em> 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).</p></div><div class="refsect2" title="pango.Renderer.draw_trapezoid"><a name="method-pangorenderer--draw-trapezoid"></a><h3>pango.Renderer.draw_trapezoid</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">draw_trapezoid</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>part</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y1_</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x11</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x21</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>y2</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x12</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>x22</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>part</code></strong> :</span></p></td><td>where the trapezoid is to be
rendered</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y1_</code></strong> :</span></p></td><td>the Y coordinate of the top of the
trapezoid</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>x11</code></strong> :</span></p></td><td>the X coordinate of the left end of the top of
the trapezoid</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>x21</code></strong> :</span></p></td><td>the X coordinate of the right end of the top of
the trapezoid</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y2</code></strong> :</span></p></td><td>the Y coordinate of the bottom of the
trapezoid</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>x12</code></strong> :</span></p></td><td>the X coordinate of the left end of the bottom of
the trapezoid</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>x22</code></strong> :</span></p></td><td>the X coordinate of the left end of the bottom of
the trapezoid</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">draw_trapezoid</code>() method draws a
trapezoid with the parallel sides aligned with the X axis using the
coordinates specified by <em class="parameter"><code>y1_</code></em>,
<em class="parameter"><code>x11</code></em>, <em class="parameter"><code>x21</code></em>,
<em class="parameter"><code>y2</code></em>, <em class="parameter"><code>x12</code></em>,
<em class="parameter"><code>x22</code></em>. The coordinates are in device space. The
trapezoid is rendered in the part specified by <em class="parameter"><code>part</code></em>
which must be one of the <a class="xref" href="pango-constants.html#pango-render-part-constants" title="Pango Render Part Constants">Pango Render Part Constants</a>.</p></div><div class="refsect2" title="pango.Renderer.activate"><a name="method-pangorenderer--activate"></a><h3>pango.Renderer.activate</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">activate</span>()</code></pre><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">activate</code>() method does initial
setup before performing the rendering operations on renderer. The <a class="link" href="class-pangorenderer.html#method-pangorenderer--deactivate" title="pango.Renderer.deactivate"><code class="methodname">deactivate</code>()</a>
method should be called when drawing is complete. Calls to the <a class="link" href="class-pangorenderer.html#method-pangorenderer--draw-layout" title="pango.Renderer.draw_layout"><code class="methodname">draw_layout</code>()</a>
method automatically activate the layout before drawing on it. Calls to the
<a class="link" href="class-pangorenderer.html#method-pangorenderer--activate" title="pango.Renderer.activate"><code class="methodname">activate</code>()</a>
and <a class="link" href="class-pangorenderer.html#method-pangorenderer--deactivate" title="pango.Renderer.deactivate"><code class="methodname">deactivate</code>()</a>
methods can be nested and the renderer will only be initialized and
deinitialized once.</p></div><div class="refsect2" title="pango.Renderer.deactivate"><a name="method-pangorenderer--deactivate"></a><h3>pango.Renderer.deactivate</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">deactivate</span>()</code></pre><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">deactivate</code>() method cleans up after
rendering operations are completed. See the <a class="link" href="class-pangorenderer.html#method-pangorenderer--activate" title="pango.Renderer.activate"><code class="methodname">activate</code>()</a>
method for more information.</p></div><div class="refsect2" title="pango.Renderer.part_changed"><a name="method-pangorenderer--part-changed"></a><h3>pango.Renderer.part_changed</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">part_changed</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>part</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>part</code></strong> :</span></p></td><td>the part that has its rendering
changed.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">part_changed</code>() method informs Pango
that the way that the renderering is done for the part specified by
<em class="parameter"><code>part</code></em> has changed in a way that would prevent multiple
pieces being joined together into one drawing
call. <em class="parameter"><code>part</code></em> must be one of the <a class="xref" href="pango-constants.html#pango-render-part-constants" title="Pango Render Part Constants">Pango Render Part Constants</a>. For instance, if a
subclass of <a class="link" href="class-pangorenderer.html" title="pango.Renderer"><code class="classname">pango.Renderer</code></a>
was to add a stipple option for drawing underlines, it needs to call:</p><pre class="programlisting">
renderer.part_changed(pango.RENDER_PART_UNDERLINE)
</pre><p>when the stipple changes or underlines with different stipples
might be joined together. Pango automatically calls this for changes to
colors. (See the <a class="link" href="class-pangorenderer.html#method-pangorenderer--set-color" title="pango.Renderer.set_color"><code class="methodname">set_color</code>()</a>
method for more information).</p></div><div class="refsect2" title="pango.Renderer.set_color"><a name="method-pangorenderer--set-color"></a><h3>pango.Renderer.set_color</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_color</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>part</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>color</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>part</code></strong> :</span></p></td><td>the part to change the color
of</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>color</code></strong> :</span></p></td><td>a <a class="link" href="class-pangocolor.html" title="pango.Color"><code class="classname">pango.Color</code></a></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">set_color</code>() method sets the <a class="link" href="class-pangocolor.html" title="pango.Color"><code class="classname">pango.Color</code></a>
specified by <em class="parameter"><code>color</code></em> as the color for the part
specified by <em class="parameter"><code>part</code></em>. <em class="parameter"><code>part</code></em> must
be one of the <a class="xref" href="pango-constants.html#pango-render-part-constants" title="Pango Render Part Constants">Pango Render Part Constants</a>.</p></div><div class="refsect2" title="pango.Renderer.get_color"><a name="method-pangorenderer--get-color"></a><h3>pango.Renderer.get_color</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_color</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>part</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>part</code></strong> :</span></p></td><td>a part</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :, </span><span class="term"><strong class="parameter"><code></code></strong> :</span></p></td><td>a <a class="link" href="class-pangocolor.html" title="pango.Color"><code class="classname">pango.Color</code></a> or
<em class="parameter"><code>None</code></em></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">get_color</code>() method returns the
current rendering <a class="link" href="class-pangocolor.html" title="pango.Color"><code class="classname">pango.Color</code></a> for the
part specified by <em class="parameter"><code>part</code></em>. <em class="parameter"><code>part</code></em>
must be one of the <a class="xref" href="pango-constants.html#pango-render-part-constants" title="Pango Render Part Constants">Pango Render Part Constants</a>. If
<code class="literal">None</code> is returned, the color has not been set and should
be inherited from the environment.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-pangolayoutline.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pango-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-pangotabarray.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">pango.LayoutLine </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> pango.TabArray</td></tr></table></div></body></html>
|