summaryrefslogtreecommitdiff
path: root/docs/reference/pygtk-pangoglyphstring.xml
blob: ab0fea584b8985ebe984ce271597c6b43886bc80 (plain)
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-pangoglyphstring">
  <refnamediv>
    <refname>pango.GlyphString</refname>
    <refpurpose>an object holding strings of glyphs and glyph
information.</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>pango.GlyphString</classname></ooclass>
      <ooclass><classname>gobject.GBoxed</classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link
linkend="constructor-pangoglyphstring">pango.GlyphString</link></methodname>
	<methodparam></methodparam>  </constructorsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-pangoglyphstring--set-size">set_size</link></methodname>
	<methodparam><parameter
		       role="keyword">new_len</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-pangoglyphstring--copy">copy</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-pangoglyphstring--extents">extents</link></methodname>
	<methodparam><parameter
		       role="keyword">font</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-pangoglyphstring--extents-range">extents_range</link></methodname>
	<methodparam><parameter
		       role="keyword">start</parameter></methodparam>
	<methodparam><parameter role="keyword">end</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">font</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-pangoglyphstring--get-logical-widths">get_logical_widths</link></methodname>
	<methodparam><parameter
		       role="keyword">text</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">embedding_level</parameter></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Attributes</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	<?dbhtml cellpadding="5"?>
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"num_glyphs"</entry>
	      <entry>Read</entry>
	      <entry>The number of glyphs in the glyph string.</entry>
	    </row>

	</tbody>
      </tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>A <link
linkend="class-pangoglyphstring"><classname>pango.GlyphString</classname></link> 
object contains strings of glyphs with geometry and visual attribute
information.</para>

  </refsect1>

  <refsect1 id="constructor-pangoglyphstring">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
	<methodname>pango.GlyphString</methodname>
	<methodparam></methodparam>  </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>a new <link
linkend="class-pangoglyphstring"><classname>pango.GlyphString</classname></link></simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a new <link
linkend="class-pangoglyphstring"><classname>pango.GlyphString</classname></link> 
containing no glyphs.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

  <refsect2 id="method-pangoglyphstring--set-size">
      <title>pango.GlyphString.set_size</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_size</methodname>
	  <methodparam><parameter
			 role="keyword">new_len</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">new_len</parameter>&nbsp;:</term>
	  <listitem><simpara>the new length of the
string.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_size</methodname>() method resizes the glyph
string to the length specified by <parameter>new_len</parameter>.</para>

    </refsect2>

    <refsect2 id="method-pangoglyphstring--copy">
      <title>pango.GlyphString.copy</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>copy</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-pangoglyphstring"><classname>pango.GlyphString</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>copy</methodname>() method returns a <link
linkend="class-pangoglyphstring"><classname>pango.GlyphString</classname></link> 
that is a copy of the glyph string.</para>

    </refsect2>

    <refsect2 id="method-pangoglyphstring--extents">
      <title>pango.GlyphString.extents</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>extents</methodname>
	  <methodparam><parameter
			 role="keyword">font</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">font</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-pangofont"><classname>pango.Font</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a 2-tuple containing two 4-tuples representing
the ink and logical extents rectangles of the glyph
string.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>extents</methodname>() method returns a 2-tuple
containing two 4-tuples representing the logical and ink extents rectangles
of the glyph string as rendered in the <link
linkend="class-pangofont"><classname>pango.Font</classname></link> specified
by <parameter>font</parameter>. See the <link
linkend="method-pangofont--get-glyph-extents"><methodname>pango.Font.get_glyph_extents</methodname>()</link> 
for details about the interpretation of the rectangles.</para>

    </refsect2>

    <refsect2 id="method-pangoglyphstring--extents-range">
      <title>pango.GlyphString.extents_range</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>extents_range</methodname>
	  <methodparam><parameter
			 role="keyword">start</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">end</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">font</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">start</parameter>&nbsp;:</term>
	  <listitem><simpara>start index</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">end</parameter>&nbsp;:</term>
	  <listitem><simpara>end index</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">font</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-pangofont"><classname>pango.Font</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a 2-tuple containing two 4-tuples representing
the ink and logical extents rectangles of the glyph string
range.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>extents_range</methodname>() method returns a
2-tuple containing two 4-tuples representing the logical and ink extents
rectangles of a range (specified by <parameter>start</parameter> and
<parameter>end</parameter>) of the glyph string as rendered in the <link
linkend="class-pangofont"><classname>pango.Font</classname></link> specified
by <parameter>font</parameter>. The extents are relative to the start of the
glyph string range (the origin of their coordinate system is at the start of
the range, not at the start of the entire glyph string).</para>

    </refsect2>

  <refsect2 id="method-pangoglyphstring--get-logical-widths">
      <title>pango.GlyphString.get_logical_widths</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_logical_widths</methodname>
	  <methodparam><parameter
			 role="keyword">text</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">embedding_level</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">text</parameter>&nbsp;:</term>
	  <listitem><simpara>the text corresponding to the
glyphs</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">embedding_level</parameter>&nbsp;:</term>
	  <listitem><simpara>the embedding level of the
string</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list containing the calculated character
widths.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_logical_widths</methodname>() method returns
a list of the screen width of the characters in the specified
<parameter>text</parameter> that corresponds to the glyph string. When
multiple characters compose a single cluster, the width of the entire
cluster is divided equally among the characters.</para>

    </refsect2>

  </refsect1>

</refentry>