File: class-pangolayout.html

package info (click to toggle)
python-gtk2-doc 2.5.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,304 kB
  • ctags: 3,741
  • sloc: makefile: 38
file content (195 lines) | stat: -rw-r--r-- 56,252 bytes parent folder | download
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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>pango.Layout</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><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="previous" 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" lang="en"><a name="class-pangolayout"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>pango.Layout</h2><p>pango.Layout &#8212; an object representing a paragraph of text with
attributes.</p></div><div class="refsect1" lang="en"><a name="id3082573"></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"><a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a></span></span>):
<code class="constructorsynopsis">    <span class="methodname"><a href="class-pangolayout.html#constructor-pangolayout" title="Constructor">pango.Layout</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>context</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 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 href="class-pangolayout.html#method-pangolayout--set-attributes" title="pango.Layout.set_attributes">set_attributes</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>attrs</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 href="class-pangolayout.html#method-pangolayout--set-text" title="pango.Layout.set_text">set_text</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>text</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 href="class-pangolayout.html#method-pangolayout--set-markup" title="pango.Layout.set_markup">set_markup</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>markup</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>markup</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>accel_marker</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>desc</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-pangolayout.html#method-pangolayout--set-width" title="pango.Layout.set_width">set_width</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 href="class-pangolayout.html#method-pangolayout--set-wrap" title="pango.Layout.set_wrap">set_wrap</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>wrap</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 href="class-pangolayout.html#method-pangolayout--set-indent" title="pango.Layout.set_indent">set_indent</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>indent</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 href="class-pangolayout.html#method-pangolayout--set-spacing" title="pango.Layout.set_spacing">set_spacing</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>spacing</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 href="class-pangolayout.html#method-pangolayout--set-justify" title="pango.Layout.set_justify">set_justify</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>justify</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 href="class-pangolayout.html#method-pangolayout--set-alignment" title="pango.Layout.set_alignment">set_alignment</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>alignment</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 href="class-pangolayout.html#method-pangolayout--set-tabs" title="pango.Layout.set_tabs">set_tabs</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>tabs</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 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"><b class="parameter"><tt>setting</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 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 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"><b class="parameter"><tt>index</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>index</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>strong</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>old_index</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>old_trailing</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>direction</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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"><b class="parameter"><tt>x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a 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 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 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 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 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 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" lang="en"><a name="id3181724"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
  +-- <a href="class-pangolayout.html" title="pango.Layout">pango.Layout</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3181744"></a><h2>Description</h2><p>A <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a>
object represents a paragraph of text with a <a href="class-pangocontext.html" title="pango.Context"><tt class="classname">pango.Context</tt></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" lang="en"><a name="constructor-pangolayout"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">pango.Layout</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>context</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>context</tt></b>:</span></td><td>a <a href="class-pangocontext.html" title="pango.Context"><tt class="classname">pango.Context</tt></a></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a>.</td></tr></tbody></table><p>Creates a new <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a>
object with attributes initialized to the default values of the <a href="class-pangocontext.html" title="pango.Context"><tt class="classname">pango.Context</tt></a>
specified by <i class="parameter"><tt>context</tt></i>.</p></div><div class="refsect1" lang="en"><a name="id3181859"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-pangolayout--copy"></a><h3>pango.Layout.copy</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">copy</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a> that
is a copy of the layout</td></tr></tbody></table><p>The <tt class="methodname">copy</tt>() method returns a <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></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" lang="en"><a name="method-pangolayout--get-context"></a><h3>pango.Layout.get_context</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_context</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the <a href="class-pangocontext.html" title="pango.Context"><tt class="classname">pango.Context</tt></a> for
the layout.</td></tr></tbody></table><p>The <tt class="methodname">get_context</tt>() method returns the
<a href="class-pangocontext.html" title="pango.Context"><tt class="classname">pango.Context</tt></a>
used for this layout.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--set-attributes"></a><h3>pango.Layout.set_attributes</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_attributes</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>attrs</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>attrs</tt></b>:</span></td><td>a <a href="class-pangoattrlist.html" title="pango.AttrList"><tt class="classname">pango.AttrList</tt></a></td></tr></tbody></table><p>The <tt class="methodname">set_attributes</tt>() method sets the
<a href="class-pangoattrlist.html" title="pango.AttrList"><tt class="classname">pango.AttrList</tt></a>
for the layout object to the value specified by
<i class="parameter"><tt>attrs</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--get-attributes"></a><h3>pango.Layout.get_attributes</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_attributes</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-pangoattrlist.html" title="pango.AttrList"><tt class="classname">pango.AttrList</tt></a></td></tr></tbody></table><p>The <tt class="methodname">get_attributes</tt>() method returns the
<a href="class-pangoattrlist.html" title="pango.AttrList"><tt class="classname">pango.AttrList</tt></a>
for the layout, if any.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--set-text"></a><h3>pango.Layout.set_text</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_text</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>text</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>text</tt></b>:</span></td><td>a UTF8-string</td></tr></tbody></table><p>The <tt class="methodname">set_text</tt>() method sets the text of
the layout to the value specified by <i class="parameter"><tt>text</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--get-text"></a><h3>pango.Layout.get_text</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_text</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the text in the layout</td></tr></tbody></table><p>The <tt class="methodname">get_text</tt>() method returns the text
in the layout.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--set-markup"></a><h3>pango.Layout.set_markup</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_markup</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>markup</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>markup</tt></b>:</span></td><td>marked-up text</td></tr></tbody></table><p>The <tt class="methodname">set_markup</tt>() method is the same as
the <a href="class-pangolayout.html#method-pangolayout--set-markup-with-accel" title="pango.Layout.set_markup_with_accel"><tt class="methodname">set_markup_with_accel</tt>()</a> 
method but the markup text isn't scanned for accelerators.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--set-markup-with-accel"></a><h3>pango.Layout.set_markup_with_accel</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_markup_with_accel</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>markup</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>accel_marker</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>markup</tt></b>:</span></td><td>some marked-up text (see the <a href="pango-markup-language.html" title="The Pango Markup Language">Pango Markup Language</a> reference
page)</td></tr><tr><td><span class="term"><b class="parameter"><tt>accel_marker</tt></b>:</span></td><td>marker for accelerators in the
text</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the accelerator character if
any</td></tr></tbody></table><p>The <tt class="methodname">set_markup_with_accel</tt>() method sets
the layout text and attribute list from marked-up text to the value
specified by <i class="parameter"><tt>markup_format</tt></i> (see the <a 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
<i class="parameter"><tt>accel_marker</tt></i> 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
<tt class="literal">pango.UNDERLINE_LOW</tt> attribute, and the accelerator
character will be returned in <i class="parameter"><tt>accel_char</tt></i>. A literal
<i class="parameter"><tt>accel_marker</tt></i> character can be put in the markup by
using two <i class="parameter"><tt>accel_marker</tt></i> characters together.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--set-font-description"></a><h3>pango.Layout.set_font_description</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_font_description</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>desc</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>desc</tt></b>:</span></td><td>the new <a href="class-pangofontdescription.html" title="pango.FontDescription"><tt class="classname">pango.FontDescription</tt></a>, 
or <tt class="literal">None</tt> to unset the current font
description.</td></tr></tbody></table><p>The <tt class="methodname">set_font_description</tt>() method set
the default <a href="class-pangofontdescription.html" title="pango.FontDescription"><tt class="classname">pango.FontDescription</tt></a> 
for the layout to the value specified by <i class="parameter"><tt>desc</tt></i>. If no
font description is set on the layout, the font description from the
layout's context is used.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--set-width"></a><h3>pango.Layout.set_width</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_width</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>width</tt></b>:</span></td><td>the desired width, or -1 to indicate that no
wrapping should be performed.</td></tr></tbody></table><p>The <tt class="methodname">set_width</tt>() method sets the wrap
width for the lines of the <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a> to
the value specified by <i class="parameter"><tt>width</tt></i>. If the value of
<i class="parameter"><tt>width</tt></i> is -1 no wrapping should be performed.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--get-width"></a><h3>pango.Layout.get_width</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_width</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the width</td></tr></tbody></table><p>The <tt class="methodname">get_width</tt>() method returns the
width at which the lines of the <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a>
should be wrapped.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--set-wrap"></a><h3>pango.Layout.set_wrap</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_wrap</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>wrap</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>wrap</tt></b>:</span></td><td>the wrap mode</td></tr></tbody></table><p>The <tt class="methodname">set_wrap</tt>() method sets the wrap
style to the value specified by <i class="parameter"><tt>wrap</tt></i>. 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><span class="term"><tt class="literal">pango.WRAP_WORD</tt></span></td><td>Wrap lines at word boundaries.</td></tr><tr><td><span class="term"><tt class="literal">pango.WRAP_CHAR</tt></span></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 href="class-pangolayout.html#method-pangolayout--set-width" title="pango.Layout.set_width"><tt class="function">pango.Layout.set_width()</tt></a>. 
To turn off wrapping, set the width to -1.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--get-wrap"></a><h3>pango.Layout.get_wrap</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_wrap</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>Active wrap mode.</td></tr></tbody></table><p>The <tt class="methodname">get_wrap</tt>() method returns the value
of the wrap mode for the layout. See the <a href="class-pangolayout.html#method-pangolayout--set-wrap" title="pango.Layout.set_wrap"><tt class="methodname">set_wrap</tt>()</a> 
method for more information.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--set-indent"></a><h3>pango.Layout.set_indent</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_indent</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>indent</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>indent</tt></b>:</span></td><td>the amount by which to
indent</td></tr></tbody></table><p>The <tt class="methodname">set_indent</tt>() method sets the
indentation of the first line of the layout to the value specified by
<i class="parameter"><tt>indent</tt></i>. The value of <i class="parameter"><tt>indent</tt></i>
may be negative to provide a hanging indent.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--get-indent"></a><h3>pango.Layout.get_indent</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_indent</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the indent</td></tr></tbody></table><p>The <tt class="methodname">get_indent</tt>() method returns the
amount of indentation of the first line of the layout.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--set-spacing"></a><h3>pango.Layout.set_spacing</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_spacing</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>spacing</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>spacing</tt></b>:</span></td><td>the amount of spacing (in thousandths of a
device unit)</td></tr></tbody></table><p>The <tt class="methodname">set_spacing</tt>() method sets the
amount of spacing between the lines of the layout to the value specified by
<i class="parameter"><tt>spacing</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--get-spacing"></a><h3>pango.Layout.get_spacing</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_spacing</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the spacing (in thousandths of a device
unit)</td></tr></tbody></table><p>The <tt class="methodname">get_spacing</tt>() method returns the
amount of spacing between the lines of the layout.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--set-justify"></a><h3>pango.Layout.set_justify</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_justify</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>justify</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>justify</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> the lines in the
layout should be justified.</td></tr></tbody></table><p>The <tt class="methodname">set_justify</tt>() method sets the
justification attribute to the value of <i class="parameter"><tt>justify</tt></i>. If
<i class="parameter"><tt>justify</tt></i> is <tt class="literal">TRUE</tt> 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" lang="en"><a name="method-pangolayout--get-justify"></a><h3>pango.Layout.get_justify</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_justify</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">TRUE</tt> if justification will
be used</td></tr></tbody></table><p>The <tt class="methodname">get_justify</tt>() method returns
<tt class="literal">TRUE</tt> if each complete line should be stretched to fill
the entire width of the layout.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--set-alignment"></a><h3>pango.Layout.set_alignment</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_alignment</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>alignment</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>alignment</tt></b>:</span></td><td>the new alignment</td></tr></tbody></table><p>The <tt class="methodname">set_alignment</tt>() method sets the
alignment (how partial lines are positioned within the
horizontal space available) for the layout to the value specified by
<i class="parameter"><tt>alignment</tt></i>. The value of
<i class="parameter"><tt>alignment</tt></i> must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><tt class="literal">pango.ALIGN_LEFT</tt></span></td><td>Put all available space on the right</td></tr><tr><td><span class="term"><tt class="literal">pango.ALIGN_CENTER</tt></span></td><td>Center the line within the available space</td></tr><tr><td><span class="term"><tt class="literal">pango.ALIGN_RIGHT</tt></span></td><td>Put all available space on the left</td></tr></tbody></table><p></p></div><div class="refsect2" lang="en"><a name="method-pangolayout--get-alignment"></a><h3>pango.Layout.get_alignment</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_alignment</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the alignment value</td></tr></tbody></table><p>The <tt class="methodname">get_alignment</tt>() method returns the
alignment (how partial lines are positioned within the
horizontal space available) for the layout. See the <a href="class-pangolayout.html#method-pangolayout--set-alignment" title="pango.Layout.set_alignment"><tt class="methodname">set_alignment</tt>()</a> 
method for more information.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--set-tabs"></a><h3>pango.Layout.set_tabs</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_tabs</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>tabs</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>tabs</tt></b>:</span></td><td>a <a href="class-pangotabarray.html" title="pango.TabArray"><tt class="classname">pango.TabArray</tt></a></td></tr></tbody></table><p>The <tt class="methodname">set_tabs</tt>() method sets the tabs to
the value specified by <i class="parameter"><tt>tabs</tt></i> thereby overriding the
default tabs (every 8 spaces). If <i class="parameter"><tt>tabs</tt></i> is
<tt class="literal">None</tt>, the default tabs are reinstated.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--get-tabs"></a><h3>pango.Layout.get_tabs</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_tabs</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a copy of the tabs for this layout, or
<tt class="literal">None</tt></td></tr></tbody></table><p>The <tt class="methodname">get_tabs</tt>() method returns the
current <a href="class-pangotabarray.html" title="pango.TabArray"><tt class="classname">pango.TabArray</tt></a>
used by this layout. If no <a href="class-pangotabarray.html" title="pango.TabArray"><tt class="classname">pango.TabArray</tt></a>
has been set, then the default tabs (every 8 spaces) are in use and
<tt class="literal">None</tt> is returned</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--set-single-paragraph-mode"></a><h3>pango.Layout.set_single_paragraph_mode</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_single_paragraph_mode</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>setting</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>setting</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> newlines, etc. are
not treated as paragraph separators.</td></tr></tbody></table><p>The <tt class="methodname">set_single_paragraph_mode</tt>() method
sets the single paragraph mode attribute to the value specified by
<i class="parameter"><tt>setting</tt></i>. If <i class="parameter"><tt>setting</tt></i> is
<tt class="literal">TRUE</tt>, 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" lang="en"><a name="method-pangolayout--get-single-paragraph-mode"></a><h3>pango.Layout.get_single_paragraph_mode</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_single_paragraph_mode</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">TRUE</tt> if the layout does not
break paragraphs at paragraph separator characters</td></tr></tbody></table><p>The <tt class="methodname">get_single_paragraph_mode</tt>() method
returns the value set by the <a href="class-pangolayout.html#method-pangolayout--set-single-paragraph-mode" title="pango.Layout.set_single_paragraph_mode"><tt class="methodname">set_single_paragraph_mode</tt>()</a> 
method.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--context-changed"></a><h3>pango.Layout.context_changed</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">context_changed</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><p>The <tt class="methodname">context_changed</tt>() method forces
recomputation of any state in the <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a> that
might depend on the layout's context. This method should be called if you
make changes to the <a href="class-pangocontext.html" title="pango.Context"><tt class="classname">pango.Context</tt></a>
subsequent to creating the layout.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--index-to-pos"></a><h3>pango.Layout.index_to_pos</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">index_to_pos</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>index</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>index</tt></b>:</span></td><td>byte index within the
layout</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a 4-tuple representing the grapheme's
position</td></tr></tbody></table><p>The <tt class="methodname">index_to_pos</tt>() method converts from
the specified <i class="parameter"><tt>index</tt></i> within a <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></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
<tt class="literal">x</tt> is always the leading edge of the grapheme and
<tt class="literal">x + width</tt> the trailing edge of the grapheme. If the
directionality of the grapheme is right-to-left, then
<tt class="literal">width</tt> will be negative.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--get-cursor-pos"></a><h3>pango.Layout.get_cursor_pos</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_cursor_pos</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>index</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>index</tt></b>:</span></td><td>the byte index of the
cursor</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a 2-tuple containing two 4-tuples representing
the strong and weak cursor positions</td></tr></tbody></table><p>The <tt class="methodname">get_cursor_pos</tt>() method returns a
2-tuple containing two 4-tuples representing the strong and weak cursor
positions of the specified <i class="parameter"><tt>index</tt></i> within a layout. The
position of each cursor is stored as a zero-width rectangle represented by a
4-tuple (<tt class="literal">x</tt>, <tt class="literal">y</tt>,
<tt class="literal">width</tt>, <tt class="literal">height</tt>). 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" lang="en"><a name="method-pangolayout--move-cursor-visually"></a><h3>pango.Layout.move_cursor_visually</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">move_cursor_visually</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>strong</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>old_index</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>old_trailing</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>direction</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>strong</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> 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><span class="term"><b class="parameter"><tt>old_index</tt></b>:</span></td><td>the byte index of the grapheme for the old
index</td></tr><tr><td><span class="term"><b class="parameter"><tt>old_trailing</tt></b>:</span></td><td>if 0, the cursor was at the trailing edge of
the grapheme indicated by <i class="parameter"><tt>old_index</tt></i>, if &gt; 0, the
cursor was at the leading edge.</td></tr><tr><td><span class="term"><b class="parameter"><tt>direction</tt></b>:</span></td><td>direction to move cursor. A negative value
indicates motion to the left.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></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 <tt class="methodname">move_cursor_visually</tt>() returns a
2-tuple containing:</p><div class="itemizedlist"><ul type="disc"><li>a new cursor position calculated from an old position
(specified by <i class="parameter"><tt>old_index</tt></i>) and the specified
<i class="parameter"><tt>direction</tt></i> to move visually</li><li>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 <i class="parameter"><tt>direction</tt></i> is positive, then the new
strong cursor position will be one position to the right of the old cursor
position. If <i class="parameter"><tt>direction</tt></i> 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 <tt class="methodname">move_cursor_visually</tt>() method
may move the cursor over multiple characters when multiple characters
combine to form a single grapheme.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--xy-to-index"></a><h3>pango.Layout.xy_to_index</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">xy_to_index</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>x</tt></b>:</span></td><td>the X offset (in thousandths of a device unit)
from the left edge of the layout.</td></tr><tr><td><span class="term"><b class="parameter"><tt>y</tt></b>:</span></td><td>the Y offset (in thousandths of a device unit)
from the top edge of the layout</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></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 <tt class="methodname">xy_to_index</tt>() method returns the
byte index of the character at the specified <i class="parameter"><tt>x</tt></i> and
<i class="parameter"><tt>y</tt></i> position within a layout. If the position is not
inside the layout, the closest position is chosen (the
(<i class="parameter"><tt>x</tt></i>, <i class="parameter"><tt>y</tt></i>) position will be
clamped inside the layout).</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--get-extents"></a><h3>pango.Layout.get_extents</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_extents</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></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 <tt class="methodname">get_extents</tt>() method returns a
2-tuple containing two 4-tuples representing the ink and logical extents
rectangles of the layout in device units (one pixel =
<tt class="literal">pango.SCALE</tt> 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" lang="en"><a name="method-pangolayout--get-pixel-extents"></a><h3>pango.Layout.get_pixel_extents</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_pixel_extents</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></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 <tt class="methodname">get_pixel_extents</tt>() 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 href="class-pangolayout.html#method-pangolayout--get-extents" title="pango.Layout.get_extents"><tt class="methodname">get_extents</tt>()</a> 
method for more information. This method just calls the <a href="class-pangolayout.html#method-pangolayout--get-extents" title="pango.Layout.get_extents"><tt class="methodname">get_extents</tt>()</a> 
and then converts the extents to pixels (one pixel =
<tt class="literal">pango.SCALE</tt> device units).</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--get-size"></a><h3>pango.Layout.get_size</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_size</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a 2-tuple containing the logical width and
height of the <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a></td></tr></tbody></table><p>The <tt class="methodname">get_size</tt>() method returns a 2-tuple
containing the logical width and height of the <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a> in
pango device units (one pixel = <tt class="literal">pango.SCALE</tt> device
units).</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--get-pixel-size"></a><h3>pango.Layout.get_pixel_size</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_pixel_size</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a 2-tuple containing the logical width height
of the <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a></td></tr></tbody></table><p>The <tt class="methodname">get_pixel_size</tt>() method returns a
2-tuple containing the logical width and height of the  <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a> in
pixels (one pixel = <tt class="literal">pango.SCALE</tt> device units). (The <a href="class-pangolayout.html#method-pangolayout--get-size" title="pango.Layout.get_size"><tt class="methodname">get_size</tt>()</a> 
returns the width and height in device units.)</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--get-line-count"></a><h3>pango.Layout.get_line_count</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_line_count</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the line count</td></tr></tbody></table><p>The <tt class="methodname">get_line_count</tt>() method returns the
count of lines in the layout.</p></div><div class="refsect2" lang="en"><a name="method-pangolayout--get-iter"></a><h3>pango.Layout.get_iter</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_iter</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-pangolayoutiter.html" title="pango.LayoutIter"><tt class="classname">pango.LayoutIter</tt></a>
object</td></tr></tbody></table><div class="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 <tt class="methodname">get_iter</tt>() method returns a <a href="class-pangolayoutiter.html" title="pango.LayoutIter"><tt class="classname">pango.LayoutIter</tt></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>