/usr/share/gtk-doc/html/pygtk/class-pangolayout.html is in python-gtk2-doc 2.24.0-5.1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>pango.Layout</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-pangolanguage.html" title="pango.Language"><link rel="next" href="class-pangolayoutiter.html" title="pango.LayoutIter"></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.Layout</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-pangolanguage.html">Prev</a> </td><th width="60%" align="center">The pango Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-pangolayoutiter.html">Next</a></td></tr></table><hr></div><div class="refentry" title="pango.Layout"><a name="class-pangolayout"></a><div class="titlepage"></div><div class="refnamediv"><h2>pango.Layout</h2><p>pango.Layout — an object representing a paragraph of text with
attributes.</p></div><div class="refsect1" title="Synopsis"><a name="id3336431"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">pango.Layout</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-pangolayout.html#constructor-pangolayout" title="Constructor">pango.Layout</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>context</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--copy" title="pango.Layout.copy">copy</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-context" title="pango.Layout.get_context">get_context</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--set-attributes" title="pango.Layout.set_attributes">set_attributes</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>attrs</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-attributes" title="pango.Layout.get_attributes">get_attributes</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--set-text" title="pango.Layout.set_text">set_text</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>text</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-text" title="pango.Layout.get_text">get_text</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--set-markup" title="pango.Layout.set_markup">set_markup</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>markup</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--set-markup-with-accel" title="pango.Layout.set_markup_with_accel">set_markup_with_accel</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>markup</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_marker</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-font-description" title="pango.Layout.get_font_description">get_font_description</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--set-font-description" title="pango.Layout.set_font_description">set_font_description</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>desc</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--set-width" title="pango.Layout.set_width">set_width</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-width" title="pango.Layout.get_width">get_width</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--set-wrap" title="pango.Layout.set_wrap">set_wrap</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>wrap</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-wrap" title="pango.Layout.get_wrap">get_wrap</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--set-indent" title="pango.Layout.set_indent">set_indent</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>indent</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-indent" title="pango.Layout.get_indent">get_indent</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--set-spacing" title="pango.Layout.set_spacing">set_spacing</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>spacing</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-spacing" title="pango.Layout.get_spacing">get_spacing</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--set-justify" title="pango.Layout.set_justify">set_justify</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>justify</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-justify" title="pango.Layout.get_justify">get_justify</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--set-alignment" title="pango.Layout.set_alignment">set_alignment</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>alignment</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-alignment" title="pango.Layout.get_alignment">get_alignment</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--set-tabs" title="pango.Layout.set_tabs">set_tabs</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>tabs</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-tabs" title="pango.Layout.get_tabs">get_tabs</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--set-single-paragraph-mode" title="pango.Layout.set_single_paragraph_mode">set_single_paragraph_mode</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>setting</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-single-paragraph-mode" title="pango.Layout.get_single_paragraph_mode">get_single_paragraph_mode</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--context-changed" title="pango.Layout.context_changed">context_changed</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--index-to-pos" title="pango.Layout.index_to_pos">index_to_pos</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-cursor-pos" title="pango.Layout.get_cursor_pos">get_cursor_pos</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--move-cursor-visually" title="pango.Layout.move_cursor_visually">move_cursor_visually</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>strong</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>old_index</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>old_trailing</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>direction</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--xy-to-index" title="pango.Layout.xy_to_index">xy_to_index</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>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-extents" title="pango.Layout.get_extents">get_extents</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-pixel-extents" title="pango.Layout.get_pixel_extents">get_pixel_extents</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-size" title="pango.Layout.get_size">get_size</a></span>()</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-pixel-size" title="pango.Layout.get_pixel_size">get_pixel_size</a></span>()</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-line-count" title="pango.Layout.get_line_count">get_line_count</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-line" title="pango.Layout.get_line">get_line</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>line</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolayout.html#method-pangolayout--get-iter" title="pango.Layout.get_iter">get_iter</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id3308416"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-pangolayout.html" title="pango.Layout">pango.Layout</a>
</pre></div><div class="refsect1" title="Description"><a name="id3308193"></a><h2>Description</h2><p>A <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a>
object represents a paragraph of text with a <a class="link" href="class-pangocontext.html" title="pango.Context"><code class="classname">pango.Context</code></a>, a
UTF-8 text string and a set of attributes for that string. The set of
formatted lines can be extracted from the object, the layout can be
rendered, and conversion between logical character positions within the
layout's text, and the physical position of the resulting glyphs can be
made. Also there are a number of attributes that adjust the formatting of
the layout.</p></div><div class="refsect1" title="Constructor"><a name="constructor-pangolayout"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">pango.Layout</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>context</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>context</code></strong> :</span></p></td><td>a <a class="link" href="class-pangocontext.html" title="pango.Context"><code class="classname">pango.Context</code></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a>.</td></tr></tbody></table><p>Creates a new <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a>
object with attributes initialized to the default values of the <a class="link" href="class-pangocontext.html" title="pango.Context"><code class="classname">pango.Context</code></a>
specified by <em class="parameter"><code>context</code></em>.</p></div><div class="refsect1" title="Methods"><a name="id3270123"></a><h2>Methods</h2><div class="refsect2" title="pango.Layout.copy"><a name="method-pangolayout--copy"></a><h3>pango.Layout.copy</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">copy</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a> that
is a copy of the layout</td></tr></tbody></table><p>The <code class="methodname">copy</code>() method returns a <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a> that
is a deep copy-by-value of the layout. The attribute list, tab array, and
text from the layout are all copied by value.</p></div><div class="refsect2" title="pango.Layout.get_context"><a name="method-pangolayout--get-context"></a><h3>pango.Layout.get_context</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_context</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the <a class="link" href="class-pangocontext.html" title="pango.Context"><code class="classname">pango.Context</code></a> for
the layout.</td></tr></tbody></table><p>The <code class="methodname">get_context</code>() method returns the
<a class="link" href="class-pangocontext.html" title="pango.Context"><code class="classname">pango.Context</code></a>
used for this layout.</p></div><div class="refsect2" title="pango.Layout.set_attributes"><a name="method-pangolayout--set-attributes"></a><h3>pango.Layout.set_attributes</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_attributes</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>attrs</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>attrs</code></strong> :</span></p></td><td>a <a class="link" href="class-pangoattrlist.html" title="pango.AttrList"><code class="classname">pango.AttrList</code></a></td></tr></tbody></table><p>The <code class="methodname">set_attributes</code>() method sets the
<a class="link" href="class-pangoattrlist.html" title="pango.AttrList"><code class="classname">pango.AttrList</code></a>
for the layout object to the value specified by
<em class="parameter"><code>attrs</code></em>.</p></div><div class="refsect2" title="pango.Layout.get_attributes"><a name="method-pangolayout--get-attributes"></a><h3>pango.Layout.get_attributes</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_attributes</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a <a class="link" href="class-pangoattrlist.html" title="pango.AttrList"><code class="classname">pango.AttrList</code></a></td></tr></tbody></table><p>The <code class="methodname">get_attributes</code>() method returns the
<a class="link" href="class-pangoattrlist.html" title="pango.AttrList"><code class="classname">pango.AttrList</code></a>
for the layout, if any.</p></div><div class="refsect2" title="pango.Layout.set_text"><a name="method-pangolayout--set-text"></a><h3>pango.Layout.set_text</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_text</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>text</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>text</code></strong> :</span></p></td><td>a UTF8-string</td></tr></tbody></table><p>The <code class="methodname">set_text</code>() method sets the text of
the layout to the value specified by <em class="parameter"><code>text</code></em>.</p></div><div class="refsect2" title="pango.Layout.get_text"><a name="method-pangolayout--get-text"></a><h3>pango.Layout.get_text</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_text</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the text in the layout</td></tr></tbody></table><p>The <code class="methodname">get_text</code>() method returns the text
in the layout.</p></div><div class="refsect2" title="pango.Layout.set_markup"><a name="method-pangolayout--set-markup"></a><h3>pango.Layout.set_markup</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_markup</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>markup</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>markup</code></strong> :</span></p></td><td>marked-up text</td></tr></tbody></table><p>The <code class="methodname">set_markup</code>() method is the same as
the <a class="link" href="class-pangolayout.html#method-pangolayout--set-markup-with-accel" title="pango.Layout.set_markup_with_accel"><code class="methodname">set_markup_with_accel</code>()</a>
method but the markup text isn't scanned for accelerators.</p></div><div class="refsect2" title="pango.Layout.set_markup_with_accel"><a name="method-pangolayout--set-markup-with-accel"></a><h3>pango.Layout.set_markup_with_accel</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_markup_with_accel</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>markup</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>accel_marker</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>markup</code></strong> :</span></p></td><td>some marked-up text (see the <a class="link" href="pango-markup-language.html" title="The Pango Markup Language">Pango Markup Language</a> reference
page)</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>accel_marker</code></strong> :</span></p></td><td>marker for accelerators in the
text</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the accelerator character if
any</td></tr></tbody></table><p>The <code class="methodname">set_markup_with_accel</code>() method sets
the layout text and attribute list from marked-up text to the value
specified by <em class="parameter"><code>markup_format</code></em> (see the <a class="link" href="pango-markup-language.html" title="The Pango Markup Language">Pango Markup Language</a> reference
page). The current text and attribute list of the layout are replaced. If
<em class="parameter"><code>accel_marker</code></em> is nonzero the markup will be parsed for
the marker and the character following the first marker becomes the
accelerator character. For example, if the accelerator marker is an
underscore, the character after the first underscore will be the accelerator
character. All characters marked as an accelerator will be displayed with a
<code class="literal">pango.UNDERLINE_LOW</code> attribute, and the accelerator
character will be returned in <em class="parameter"><code>accel_char</code></em>. A literal
<em class="parameter"><code>accel_marker</code></em> character can be put in the markup by
using two <em class="parameter"><code>accel_marker</code></em> characters together.</p></div><div class="refsect2" title="pango.Layout.get_font_description"><a name="method-pangolayout--get-font-description"></a><h3>pango.Layout.get_font_description</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_font_description</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the layout's font description, or <code class="literal">None</code>
if the font description from the layout's context is inherited.</td></tr></tbody></table><p>The <code class="methodname">get_font_description</code>() method returns
the font description for the layout, if any</p></div><div class="refsect2" title="pango.Layout.set_font_description"><a name="method-pangolayout--set-font-description"></a><h3>pango.Layout.set_font_description</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_font_description</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>desc</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>desc</code></strong> :</span></p></td><td>the new <a class="link" href="class-pangofontdescription.html" title="pango.FontDescription"><code class="classname">pango.FontDescription</code></a>,
or <code class="literal">None</code> to unset the current font
description.</td></tr></tbody></table><p>The <code class="methodname">set_font_description</code>() method set
the default <a class="link" href="class-pangofontdescription.html" title="pango.FontDescription"><code class="classname">pango.FontDescription</code></a>
for the layout to the value specified by <em class="parameter"><code>desc</code></em>. If no
font description is set on the layout, the font description from the
layout's context is used.</p></div><div class="refsect2" title="pango.Layout.set_width"><a name="method-pangolayout--set-width"></a><h3>pango.Layout.set_width</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_width</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>width</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>width</code></strong> :</span></p></td><td>the desired width, or -1 to indicate that no
wrapping should be performed.</td></tr></tbody></table><p>The <code class="methodname">set_width</code>() method sets the wrap
width for the lines of the <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a> to
the value specified by <em class="parameter"><code>width</code></em>. If the value of
<em class="parameter"><code>width</code></em> is -1 no wrapping should be performed.</p></div><div class="refsect2" title="pango.Layout.get_width"><a name="method-pangolayout--get-width"></a><h3>pango.Layout.get_width</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_width</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the width</td></tr></tbody></table><p>The <code class="methodname">get_width</code>() method returns the
width at which the lines of the <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a>
should be wrapped.</p></div><div class="refsect2" title="pango.Layout.set_wrap"><a name="method-pangolayout--set-wrap"></a><h3>pango.Layout.set_wrap</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_wrap</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>wrap</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>wrap</code></strong> :</span></p></td><td>the wrap mode</td></tr></tbody></table><p>The <code class="methodname">set_wrap</code>() method sets the wrap
style to the value specified by <em class="parameter"><code>wrap</code></em>. The value of
wrap must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><code class="literal">pango.WRAP_WORD</code></span></p></td><td>Wrap lines at word boundaries.</td></tr><tr><td><p><span class="term"><code class="literal">pango.WRAP_WORD_CHAR</code></span></p></td><td>wrap lines at word boundaries, but fall back to character
boundaries if there is not enough space for a full word.</td></tr><tr><td><p><span class="term"><code class="literal">pango.WRAP_CHAR</code></span></p></td><td>Wrap lines at character boundaries.</td></tr></tbody></table><p>The wrap style is in effect if a width is set on the layout with
the <a class="link" href="class-pangolayout.html#method-pangolayout--set-width" title="pango.Layout.set_width"><code class="function">pango.Layout.set_width()</code></a>.
To turn off wrapping, set the width to -1.</p></div><div class="refsect2" title="pango.Layout.get_wrap"><a name="method-pangolayout--get-wrap"></a><h3>pango.Layout.get_wrap</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_wrap</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>Active wrap mode.</td></tr></tbody></table><p>The <code class="methodname">get_wrap</code>() method returns the value
of the wrap mode for the layout. See the <a class="link" href="class-pangolayout.html#method-pangolayout--set-wrap" title="pango.Layout.set_wrap"><code class="methodname">set_wrap</code>()</a>
method for more information.</p></div><div class="refsect2" title="pango.Layout.set_indent"><a name="method-pangolayout--set-indent"></a><h3>pango.Layout.set_indent</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_indent</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>indent</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>indent</code></strong> :</span></p></td><td>the amount by which to
indent</td></tr></tbody></table><p>The <code class="methodname">set_indent</code>() method sets the
indentation of the first line of the layout to the value specified by
<em class="parameter"><code>indent</code></em>. The value of <em class="parameter"><code>indent</code></em>
may be negative to provide a hanging indent.</p></div><div class="refsect2" title="pango.Layout.get_indent"><a name="method-pangolayout--get-indent"></a><h3>pango.Layout.get_indent</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_indent</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the indent</td></tr></tbody></table><p>The <code class="methodname">get_indent</code>() method returns the
amount of indentation of the first line of the layout.</p></div><div class="refsect2" title="pango.Layout.set_spacing"><a name="method-pangolayout--set-spacing"></a><h3>pango.Layout.set_spacing</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_spacing</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>spacing</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>spacing</code></strong> :</span></p></td><td>the amount of spacing (in 1/<code class="literal">pango.SCALE</code> of a
device unit)</td></tr></tbody></table><p>The <code class="methodname">set_spacing</code>() method sets the
amount of spacing between the lines of the layout to the value specified by
<em class="parameter"><code>spacing</code></em>.</p></div><div class="refsect2" title="pango.Layout.get_spacing"><a name="method-pangolayout--get-spacing"></a><h3>pango.Layout.get_spacing</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_spacing</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the spacing (in 1/<code class="literal">pango.SCALE</code> of a device
unit)</td></tr></tbody></table><p>The <code class="methodname">get_spacing</code>() method returns the
amount of spacing between the lines of the layout.</p></div><div class="refsect2" title="pango.Layout.set_justify"><a name="method-pangolayout--set-justify"></a><h3>pango.Layout.set_justify</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_justify</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>justify</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>justify</code></strong> :</span></p></td><td>if <code class="literal">True</code> the lines in the
layout should be justified.</td></tr></tbody></table><p>The <code class="methodname">set_justify</code>() method sets the
justification attribute to the value of <em class="parameter"><code>justify</code></em>. If
<em class="parameter"><code>justify</code></em> is <code class="literal">True</code> each complete line
should be stretched to fill the entire width of the layout. This stretching
is typically done by adding whitespace, but for some scripts (such as
Arabic), the justification is done by extending the characters.</p></div><div class="refsect2" title="pango.Layout.get_justify"><a name="method-pangolayout--get-justify"></a><h3>pango.Layout.get_justify</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_justify</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if justification will
be used</td></tr></tbody></table><p>The <code class="methodname">get_justify</code>() method returns
<code class="literal">True</code> if each complete line should be stretched to fill
the entire width of the layout.</p></div><div class="refsect2" title="pango.Layout.set_alignment"><a name="method-pangolayout--set-alignment"></a><h3>pango.Layout.set_alignment</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_alignment</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>alignment</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>alignment</code></strong> :</span></p></td><td>the new alignment</td></tr></tbody></table><p>The <code class="methodname">set_alignment</code>() method sets the
alignment (how partial lines are positioned within the
horizontal space available) for the layout to the value specified by
<em class="parameter"><code>alignment</code></em>. The value of
<em class="parameter"><code>alignment</code></em> must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><code class="literal">pango.ALIGN_LEFT</code></span></p></td><td>Put all available space on the right</td></tr><tr><td><p><span class="term"><code class="literal">pango.ALIGN_CENTER</code></span></p></td><td>Center the line within the available space</td></tr><tr><td><p><span class="term"><code class="literal">pango.ALIGN_RIGHT</code></span></p></td><td>Put all available space on the left</td></tr></tbody></table><p></p></div><div class="refsect2" title="pango.Layout.get_alignment"><a name="method-pangolayout--get-alignment"></a><h3>pango.Layout.get_alignment</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_alignment</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the alignment value</td></tr></tbody></table><p>The <code class="methodname">get_alignment</code>() method returns the
alignment (how partial lines are positioned within the
horizontal space available) for the layout. See the <a class="link" href="class-pangolayout.html#method-pangolayout--set-alignment" title="pango.Layout.set_alignment"><code class="methodname">set_alignment</code>()</a>
method for more information.</p></div><div class="refsect2" title="pango.Layout.set_tabs"><a name="method-pangolayout--set-tabs"></a><h3>pango.Layout.set_tabs</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_tabs</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>tabs</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>tabs</code></strong> :</span></p></td><td>a <a class="link" href="class-pangotabarray.html" title="pango.TabArray"><code class="classname">pango.TabArray</code></a></td></tr></tbody></table><p>The <code class="methodname">set_tabs</code>() method sets the tabs to
the value specified by <em class="parameter"><code>tabs</code></em> thereby overriding the
default tabs (every 8 spaces). If <em class="parameter"><code>tabs</code></em> is
<code class="literal">None</code>, the default tabs are reinstated.</p></div><div class="refsect2" title="pango.Layout.get_tabs"><a name="method-pangolayout--get-tabs"></a><h3>pango.Layout.get_tabs</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_tabs</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a copy of the tabs for this layout, or
<code class="literal">None</code></td></tr></tbody></table><p>The <code class="methodname">get_tabs</code>() method returns the
current <a class="link" href="class-pangotabarray.html" title="pango.TabArray"><code class="classname">pango.TabArray</code></a>
used by this layout. If no <a class="link" href="class-pangotabarray.html" title="pango.TabArray"><code class="classname">pango.TabArray</code></a>
has been set, then the default tabs (every 8 spaces) are in use and
<code class="literal">None</code> is returned</p></div><div class="refsect2" title="pango.Layout.set_single_paragraph_mode"><a name="method-pangolayout--set-single-paragraph-mode"></a><h3>pango.Layout.set_single_paragraph_mode</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_single_paragraph_mode</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>setting</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>setting</code></strong> :</span></p></td><td>if <code class="literal">True</code> newlines, etc. are
not treated as paragraph separators.</td></tr></tbody></table><p>The <code class="methodname">set_single_paragraph_mode</code>() method
sets the single paragraph mode attribute to the value specified by
<em class="parameter"><code>setting</code></em>. If <em class="parameter"><code>setting</code></em> is
<code class="literal">True</code>, do not treat newlines and similar characters as
paragraph separators; instead, keep all text in a single paragraph, and
display a glyph for paragraph separator characters. Used when you want to
allow editing of newlines on a single text line.</p></div><div class="refsect2" title="pango.Layout.get_single_paragraph_mode"><a name="method-pangolayout--get-single-paragraph-mode"></a><h3>pango.Layout.get_single_paragraph_mode</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_single_paragraph_mode</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the layout does not
break paragraphs at paragraph separator characters</td></tr></tbody></table><p>The <code class="methodname">get_single_paragraph_mode</code>() method
returns the value set by the <a class="link" href="class-pangolayout.html#method-pangolayout--set-single-paragraph-mode" title="pango.Layout.set_single_paragraph_mode"><code class="methodname">set_single_paragraph_mode</code>()</a>
method.</p></div><div class="refsect2" title="pango.Layout.context_changed"><a name="method-pangolayout--context-changed"></a><h3>pango.Layout.context_changed</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">context_changed</span>(<span class="methodparam"></span>)</code></pre><p>The <code class="methodname">context_changed</code>() method forces
recomputation of any state in the <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a> that
might depend on the layout's context. This method should be called if you
make changes to the <a class="link" href="class-pangocontext.html" title="pango.Context"><code class="classname">pango.Context</code></a>
subsequent to creating the layout.</p></div><div class="refsect2" title="pango.Layout.index_to_pos"><a name="method-pangolayout--index-to-pos"></a><h3>pango.Layout.index_to_pos</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">index_to_pos</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</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>index</code></strong> :</span></p></td><td>byte index within the
layout</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 4-tuple representing the grapheme's
position</td></tr></tbody></table><p>The <code class="methodname">index_to_pos</code>() method converts from
the specified <em class="parameter"><code>index</code></em> within a <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a> to
the onscreen position corresponding to the grapheme at that index, which is
represented as a 4-tuple (x, y, width, height). Note that
<code class="literal">x</code> is always the leading edge of the grapheme and
<code class="literal">x + width</code> the trailing edge of the grapheme. If the
directionality of the grapheme is right-to-left, then
<code class="literal">width</code> will be negative.</p></div><div class="refsect2" title="pango.Layout.get_cursor_pos"><a name="method-pangolayout--get-cursor-pos"></a><h3>pango.Layout.get_cursor_pos</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_cursor_pos</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</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>index</code></strong> :</span></p></td><td>the byte index of the
cursor</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 2-tuple containing two 4-tuples representing
the strong and weak cursor positions</td></tr></tbody></table><p>The <code class="methodname">get_cursor_pos</code>() method returns a
2-tuple containing two 4-tuples representing the strong and weak cursor
positions of the specified <em class="parameter"><code>index</code></em> within a layout. The
position of each cursor is stored as a zero-width rectangle represented by a
4-tuple (<code class="literal">x</code>, <code class="literal">y</code>,
<code class="literal">width</code>, <code class="literal">height</code>). The strong cursor
location is the location where characters of the directionality equal to the
base direction of the layout are inserted. The weak cursor location is the
location where characters of the directionality opposite to the base
direction of the layout are inserted.</p></div><div class="refsect2" title="pango.Layout.move_cursor_visually"><a name="method-pangolayout--move-cursor-visually"></a><h3>pango.Layout.move_cursor_visually</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">move_cursor_visually</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>strong</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>old_index</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>old_trailing</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>direction</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>strong</code></strong> :</span></p></td><td>if <code class="literal">True</code> the moving cursor is
the strong cursor; otherwise, the weak cursor. The strong cursor is the
cursor corresponding to text insertion in the base direction for the
layout.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>old_index</code></strong> :</span></p></td><td>the byte index of the grapheme for the old
index</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>old_trailing</code></strong> :</span></p></td><td>if 0, the cursor was at the trailing edge of
the grapheme indicated by <em class="parameter"><code>old_index</code></em>, if > 0, the
cursor was at the leading edge.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>direction</code></strong> :</span></p></td><td>direction to move cursor. A negative value
indicates motion to the left.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 2-tuple containing: the new cursor byte index
(a value of -1 indicates that the cursor has been moved off the beginning of
the layout while a value of G_MAXINT indicates that the cursor has been
moved off the end of the layout); and, the number of characters to move
forward (from the new cursor position) to get the position where the cursor
should be displayed.</td></tr></tbody></table><p>The <code class="methodname">move_cursor_visually</code>() returns a
2-tuple containing:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">a new cursor position calculated from an old position
(specified by <em class="parameter"><code>old_index</code></em>) and the specified
<em class="parameter"><code>direction</code></em> to move visually</li><li class="listitem">the number of characters to move forward (from the new
cursor position) to get the position where the cursor should be displayed.
This allows distinguishing the position at the beginning of one line from
the position at the end of the preceding line. the first value is always on
the line where the cursor should be displayed.</li></ul></div><p>If <em class="parameter"><code>direction</code></em> is positive, then the new
strong cursor position will be one position to the right of the old cursor
position. If <em class="parameter"><code>direction</code></em> is negative then the new
strong cursor position will be one position to the left of the old cursor
position.</p><p>In the presence of bidirectional text, the correspondence
between logical and visual order will depend on the direction of the current
run, and there may be jumps when the cursor is moved off of the end of a
run.</p><p>Motion here is in cursor positions, not in characters, so a
single call to the <code class="methodname">move_cursor_visually</code>() method
may move the cursor over multiple characters when multiple characters
combine to form a single grapheme.</p></div><div class="refsect2" title="pango.Layout.xy_to_index"><a name="method-pangolayout--xy-to-index"></a><h3>pango.Layout.xy_to_index</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">xy_to_index</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>x</code></strong> :</span></p></td><td>the X offset (in 1/<code class="literal">pango.SCALE</code> of a device unit)
from the left edge of the layout.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>y</code></strong> :</span></p></td><td>the Y offset (in 1/<code class="literal">pango.SCALE</code> of a device unit)
from the top edge of the layout</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 2-tuple containing the calculated byte index
and an integer indicating where in the grapheme the user clicked (it will
either be zero, or the number of characters in the grapheme - 0 represents
the trailing edge of the grapheme).</td></tr></tbody></table><p>The <code class="methodname">xy_to_index</code>() method returns the
byte index of the character at the specified <em class="parameter"><code>x</code></em> and
<em class="parameter"><code>y</code></em> position within a layout. If the position is not
inside the layout, the closest position is chosen (the
(<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>) position will be
clamped inside the layout).</p></div><div class="refsect2" title="pango.Layout.get_extents"><a name="method-pangolayout--get-extents"></a><h3>pango.Layout.get_extents</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_extents</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 2-tuple containing two 4-tuples representing
the as drawn and logical extents rectangles of the layout
</td></tr></tbody></table><p>The <code class="methodname">get_extents</code>() method returns a
2-tuple containing two 4-tuples representing the ink and logical extents
rectangles of the layout in device units (one pixel =
<code class="literal">pango.SCALE</code> device units). Logical extents are usually
what you want for positioning things. The extents are given in layout
coordinates which begin at the top left corner of the layout.</p></div><div class="refsect2" title="pango.Layout.get_pixel_extents"><a name="method-pangolayout--get-pixel-extents"></a><h3>pango.Layout.get_pixel_extents</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_pixel_extents</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 2-tuple containing two 4-tuples representing
the as drawn (ink) and logical extents rectangles of the
layout</td></tr></tbody></table><p>The <code class="methodname">get_pixel_extents</code>() method returns
a 2-tuple containing two 4-tuples representing the logical and ink extents
rectangles of the layout in pixel units. See the <a class="link" href="class-pangolayout.html#method-pangolayout--get-extents" title="pango.Layout.get_extents"><code class="methodname">get_extents</code>()</a>
method for more information. This method just calls the <a class="link" href="class-pangolayout.html#method-pangolayout--get-extents" title="pango.Layout.get_extents"><code class="methodname">get_extents</code>()</a>
and then converts the extents to pixels (one pixel =
<code class="literal">pango.SCALE</code> device units).</p></div><div class="refsect2" title="pango.Layout.get_size"><a name="method-pangolayout--get-size"></a><h3>pango.Layout.get_size</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_size</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 2-tuple containing the logical width and
height of the <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a></td></tr></tbody></table><p>The <code class="methodname">get_size</code>() method returns a 2-tuple
containing the logical width and height of the <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a> in
pango device units (one pixel = <code class="literal">pango.SCALE</code> device
units).</p></div><div class="refsect2" title="pango.Layout.get_pixel_size"><a name="method-pangolayout--get-pixel-size"></a><h3>pango.Layout.get_pixel_size</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_pixel_size</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a 2-tuple containing the logical width height
of the <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a></td></tr></tbody></table><p>The <code class="methodname">get_pixel_size</code>() method returns a
2-tuple containing the logical width and height of the <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a> in
pixels (one pixel = <code class="literal">pango.SCALE</code> device units). (The <a class="link" href="class-pangolayout.html#method-pangolayout--get-size" title="pango.Layout.get_size"><code class="methodname">get_size</code>()</a>
returns the width and height in device units.)</p></div><div class="refsect2" title="pango.Layout.get_line_count"><a name="method-pangolayout--get-line-count"></a><h3>pango.Layout.get_line_count</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_line_count</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the line count</td></tr></tbody></table><p>The <code class="methodname">get_line_count</code>() method returns the
count of lines in the layout.</p></div><div class="refsect2" title="pango.Layout.get_line"><a name="method-pangolayout--get-line"></a><h3>pango.Layout.get_line</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_line</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>line</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>the index of a line, which must be between 0 and
layout.get_line_count() - 1, inclusive.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the requested <a class="link" href="class-pangolayoutline.html" title="pango.LayoutLine"><code class="classname">pango.LayoutLine</code></a>,
or <code class="literal">None</code> if the index is out of range.</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_line</code>() method returns the line
with the index number specified by <em class="parameter"><code>line</code></em> from the
layout. The returned layout line will become invalid if changes are made to
the <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a>.</p></div><div class="refsect2" title="pango.Layout.get_iter"><a name="method-pangolayout--get-iter"></a><h3>pango.Layout.get_iter</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_iter</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-pangolayoutiter.html" title="pango.LayoutIter"><code class="classname">pango.LayoutIter</code></a>
object</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.6 and above.</p></div><p>The <code class="methodname">get_iter</code>() method returns a <a class="link" href="class-pangolayoutiter.html" title="pango.LayoutIter"><code class="classname">pango.LayoutIter</code></a>
object that can be used to iterate over the visual extents of the
layout.</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-pangolanguage.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-pangolayoutiter.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">pango.Language </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> pango.LayoutIter</td></tr></table></div></body></html>
|