Tizen 2.1 base
[external/pango1.0.git] / docs / html / pango-Vertical-Text.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Vertical Text</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.74.3">
7 <link rel="home" href="index.html" title="Pango Reference Manual">
8 <link rel="up" href="pango.html" title="Basic Pango Interfaces">
9 <link rel="prev" href="pango-Bidirectional-Text.html" title="Bidirectional Text">
10 <link rel="next" href="rendering.html" title="Rendering with Pango">
11 <meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 <link rel="chapter" href="pango.html" title="Basic Pango Interfaces">
14 <link rel="chapter" href="rendering.html" title="Rendering with Pango">
15 <link rel="chapter" href="lowlevel.html" title="Low Level Functionality">
16 <link rel="chapter" href="tools.html" title="Pango Tools">
17 <link rel="chapter" href="pango-hierarchy.html" title="Object Hierarchy">
18 <link rel="index" href="index-all.html" title="Index">
19 <link rel="index" href="index-deprecated.html" title="Index of deprecated symbols">
20 <link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
21 <link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
22 <link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
23 <link rel="index" href="index-1.8.html" title="Index of new symbols in 1.8">
24 <link rel="index" href="index-1.10.html" title="Index of new symbols in 1.10">
25 <link rel="index" href="index-1.12.html" title="Index of new symbols in 1.12">
26 <link rel="index" href="index-1.14.html" title="Index of new symbols in 1.14">
27 <link rel="index" href="index-1.16.html" title="Index of new symbols in 1.16">
28 <link rel="index" href="index-1.18.html" title="Index of new symbols in 1.18">
29 <link rel="index" href="index-1.20.html" title="Index of new symbols in 1.20">
30 <link rel="index" href="index-1.22.html" title="Index of new symbols in 1.22">
31 <link rel="index" href="index-1.24.html" title="Index of new symbols in 1.24">
32 <link rel="index" href="index-1.26.html" title="Index of new symbols in 1.26">
33 </head>
34 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
35 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
36 <tr valign="middle">
37 <td><a accesskey="p" href="pango-Bidirectional-Text.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
38 <td><a accesskey="u" href="pango.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
39 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
40 <th width="100%" align="center">Pango Reference Manual</th>
41 <td><a accesskey="n" href="rendering.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
42 </tr>
43 <tr><td colspan="5" class="shortcuts">
44 <a href="#pango-Vertical-Text.synopsis" class="shortcut">Top</a>
45                  | 
46                 <a href="#pango-Vertical-Text.description" class="shortcut">Description</a>
47 </td></tr>
48 </table>
49 <div class="refentry" lang="en">
50 <a name="pango-Vertical-Text"></a><div class="titlepage"></div>
51 <div class="refnamediv"><table width="100%"><tr>
52 <td valign="top">
53 <h2><span class="refentrytitle"><a name="pango-Vertical-Text.top_of_page"></a>Vertical Text</span></h2>
54 <p>Vertical Text — Laying text out in vertical directions</p>
55 </td>
56 <td valign="top" align="right"></td>
57 </tr></table></div>
58 <div class="refsynopsisdiv">
59 <a name="pango-Vertical-Text.synopsis"></a><h2>Synopsis</h2>
60 <pre class="synopsis">
61 enum                <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity">PangoGravity</a>;
62 enum                <a class="link" href="pango-Vertical-Text.html#PangoGravityHint" title="enum PangoGravityHint">PangoGravityHint</a>;
63 #define             <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-IS-VERTICAL--CAPS" title="PANGO_GRAVITY_IS_VERTICAL()">PANGO_GRAVITY_IS_VERTICAL</a>           (gravity)
64 <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity">PangoGravity</a>        <a class="link" href="pango-Vertical-Text.html#pango-gravity-get-for-matrix" title="pango_gravity_get_for_matrix ()">pango_gravity_get_for_matrix</a>        (const <a class="link" href="pango-Glyph-Storage.html#PangoMatrix" title="PangoMatrix">PangoMatrix</a> *matrix);
65 <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity">PangoGravity</a>        <a class="link" href="pango-Vertical-Text.html#pango-gravity-get-for-script" title="pango_gravity_get_for_script ()">pango_gravity_get_for_script</a>        (<a class="link" href="pango-Scripts-and-Languages.html#PangoScript" title="enum PangoScript">PangoScript</a> script,
66                                                          <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity">PangoGravity</a> base_gravity,
67                                                          <a class="link" href="pango-Vertical-Text.html#PangoGravityHint" title="enum PangoGravityHint">PangoGravityHint</a> hint);
68 <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity">PangoGravity</a>        <a class="link" href="pango-Vertical-Text.html#pango-gravity-get-for-script-and-width" title="pango_gravity_get_for_script_and_width ()">pango_gravity_get_for_script_and_width</a>
69                                                         (<a class="link" href="pango-Scripts-and-Languages.html#PangoScript" title="enum PangoScript">PangoScript</a> script,
70                                                          <a
71 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
72 >gboolean</a> wide,
73                                                          <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity">PangoGravity</a> base_gravity,
74                                                          <a class="link" href="pango-Vertical-Text.html#PangoGravityHint" title="enum PangoGravityHint">PangoGravityHint</a> hint);
75 double              <a class="link" href="pango-Vertical-Text.html#pango-gravity-to-rotation" title="pango_gravity_to_rotation ()">pango_gravity_to_rotation</a>           (<a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity">PangoGravity</a> gravity);
76 </pre>
77 </div>
78 <div class="refsect1" lang="en">
79 <a name="pango-Vertical-Text.description"></a><h2>Description</h2>
80 <p>
81 Since 1.16, Pango is able to correctly lay vertical text out.  In fact, it can
82 set layouts of mixed vertical and non-vertical text.  This section describes
83 the types used for setting vertical text parameters.
84 </p>
85 <p>
86 The way this is implemented is through the concept of
87 <em class="firstterm">gravity</em>.  Gravity of normal Latin text is south.  A
88 gravity value of east means that glyphs will be rotated ninety degrees
89 counterclockwise.  So, to render vertical text one needs to set the gravity
90 and rotate the layout using the matrix machinery already in place.  This has
91 the huge advantage that most algorithms working on a <a class="link" href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> do not need
92 any change as the assumption that lines run in the X direction and stack in
93 the Y direction holds even for vertical text layouts.
94 </p>
95 <p>
96 Applications should only need to set base gravity on <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> in use, and
97 let Pango decide the gravity assigned to each run of text.  This automatically
98 handles text with mixed scripts.  A very common use is to set the context base
99 gravity to auto using <a class="link" href="pango-Text-Processing.html#pango-context-set-base-gravity" title="pango_context_set_base_gravity ()"><code class="function">pango_context_set_base_gravity()</code></a>
100 and rotate the layout normally.  Pango will make sure that
101 Asian languages take the right form, while other scripts are rotated normally.
102 </p>
103 <p>
104 The correct way to set gravity on a layout is to set it on the context
105 associated with it using <a class="link" href="pango-Text-Processing.html#pango-context-set-base-gravity" title="pango_context_set_base_gravity ()"><code class="function">pango_context_set_base_gravity()</code></a>.  The context
106 of a layout can be accessed using <a class="link" href="pango-Layout-Objects.html#pango-layout-get-context" title="pango_layout_get_context ()"><code class="function">pango_layout_get_context()</code></a>.  The currently
107 set base gravity of the context can be accessed using
108 <a class="link" href="pango-Text-Processing.html#pango-context-get-base-gravity" title="pango_context_get_base_gravity ()"><code class="function">pango_context_get_base_gravity()</code></a> and the <em class="firstterm">resolved</em>
109 gravity of it using <a class="link" href="pango-Text-Processing.html#pango-context-get-gravity" title="pango_context_get_gravity ()"><code class="function">pango_context_get_gravity()</code></a>.  The resolved gravity is
110 the same as the base gravity for the most part, except that if the base
111 gravity is set to <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO--CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a>, the resolved gravity will depend
112 on the current matrix set on context, and is derived using
113 <a class="link" href="pango-Vertical-Text.html#pango-gravity-get-for-matrix" title="pango_gravity_get_for_matrix ()"><code class="function">pango_gravity_get_for_matrix()</code></a>.
114 </p>
115 <p>
116 The next thing an application may want to set on the context is the
117 <em class="firstterm">gravity hint</em>.  A <a class="link" href="pango-Vertical-Text.html#PangoGravityHint" title="enum PangoGravityHint"><span class="type">PangoGravityHint</span></a> instructs how
118 different scripts should react to the set base gravity.
119 </p>
120 <p>
121 Font descriptions have a gravity property too, that can be set using
122 <a class="link" href="pango-Fonts.html#pango-font-description-set-gravity" title="pango_font_description_set_gravity ()"><code class="function">pango_font_description_set_gravity()</code></a> and accessed using
123 <a class="link" href="pango-Fonts.html#pango-font-description-get-gravity" title="pango_font_description_get_gravity ()"><code class="function">pango_font_description_get_gravity()</code></a>.  However, those are rarely useful
124 from application code and are mainly used by <a class="link" href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> internally.
125 </p>
126 <p>
127 Last but not least, one can create <a class="link" href="pango-Text-Attributes.html#PangoAttribute" title="PangoAttribute"><span class="type">PangoAttribute</span></a>s for gravity
128 and gravity hint using <a class="link" href="pango-Text-Attributes.html#pango-attr-gravity-new" title="pango_attr_gravity_new ()"><code class="function">pango_attr_gravity_new()</code></a> and
129 <a class="link" href="pango-Text-Attributes.html#pango-attr-gravity-hint-new" title="pango_attr_gravity_hint_new ()"><code class="function">pango_attr_gravity_hint_new()</code></a>.
130 </p>
131 </div>
132 <div class="refsect1" lang="en">
133 <a name="pango-Vertical-Text.details"></a><h2>Details</h2>
134 <div class="refsect2" lang="en">
135 <a name="PangoGravity"></a><h3>enum PangoGravity</h3>
136 <pre class="programlisting">typedef enum {
137   PANGO_GRAVITY_SOUTH,
138   PANGO_GRAVITY_EAST,
139   PANGO_GRAVITY_NORTH,
140   PANGO_GRAVITY_WEST,
141   PANGO_GRAVITY_AUTO
142 } PangoGravity;
143 </pre>
144 <p>
145 The <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="type">PangoGravity</span></a> type represents the orientation of glyphs in a segment
146 of text.  This is useful when rendering vertical text layouts.  In
147 those situations, the layout is rotated using a non-identity PangoMatrix,
148 and then glyph orientation is controlled using <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="type">PangoGravity</span></a>.
149 Not every value in this enumeration makes sense for every usage of
150 <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="type">PangoGravity</span></a>; for example, <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO--CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a> only can be passed to
151 <a class="link" href="pango-Text-Processing.html#pango-context-set-base-gravity" title="pango_context_set_base_gravity ()"><code class="function">pango_context_set_base_gravity()</code></a> and can only be returned by
152 <a class="link" href="pango-Text-Processing.html#pango-context-get-base-gravity" title="pango_context_get_base_gravity ()"><code class="function">pango_context_get_base_gravity()</code></a>.
153 </p>
154 <p>
155 See also: <a class="link" href="pango-Vertical-Text.html#PangoGravityHint" title="enum PangoGravityHint"><span class="type">PangoGravityHint</span></a></p>
156 <p>
157 </p>
158 <div class="variablelist"><table border="0">
159 <col align="left" valign="top">
160 <tbody>
161 <tr>
162 <td><p><a name="PANGO-GRAVITY-SOUTH--CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_SOUTH</code></span></p></td>
163 <td> Glyphs stand upright (default)
164 </td>
165 </tr>
166 <tr>
167 <td><p><a name="PANGO-GRAVITY-EAST--CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_EAST</code></span></p></td>
168 <td> Glyphs are rotated 90 degrees clockwise
169 </td>
170 </tr>
171 <tr>
172 <td><p><a name="PANGO-GRAVITY-NORTH--CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_NORTH</code></span></p></td>
173 <td> Glyphs are upside-down
174 </td>
175 </tr>
176 <tr>
177 <td><p><a name="PANGO-GRAVITY-WEST--CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_WEST</code></span></p></td>
178 <td> Glyphs are rotated 90 degrees counter-clockwise
179 </td>
180 </tr>
181 <tr>
182 <td><p><a name="PANGO-GRAVITY-AUTO--CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_AUTO</code></span></p></td>
183 <td> Gravity is resolved from the context matrix
184 </td>
185 </tr>
186 </tbody>
187 </table></div>
188 <p class="since">Since 1.16</p>
189 </div>
190 <hr>
191 <div class="refsect2" lang="en">
192 <a name="PangoGravityHint"></a><h3>enum PangoGravityHint</h3>
193 <pre class="programlisting">typedef enum {
194   PANGO_GRAVITY_HINT_NATURAL,
195   PANGO_GRAVITY_HINT_STRONG,
196   PANGO_GRAVITY_HINT_LINE
197 } PangoGravityHint;
198 </pre>
199 <p>
200 The <a class="link" href="pango-Vertical-Text.html#PangoGravityHint" title="enum PangoGravityHint"><span class="type">PangoGravityHint</span></a> defines how horizontal scripts should behave in a
201 vertical context.  That is, English excerpt in a vertical paragraph for
202 example.
203 </p>
204 <p>
205 See <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="type">PangoGravity</span></a>.</p>
206 <p>
207 </p>
208 <div class="variablelist"><table border="0">
209 <col align="left" valign="top">
210 <tbody>
211 <tr>
212 <td><p><a name="PANGO-GRAVITY-HINT-NATURAL--CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_HINT_NATURAL</code></span></p></td>
213 <td> scripts will take their natural gravity based
214 on the base gravity and the script.  This is the default.
215 </td>
216 </tr>
217 <tr>
218 <td><p><a name="PANGO-GRAVITY-HINT-STRONG--CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_HINT_STRONG</code></span></p></td>
219 <td> always use the base gravity set, regardless of
220 the script.
221 </td>
222 </tr>
223 <tr>
224 <td><p><a name="PANGO-GRAVITY-HINT-LINE--CAPS"></a><span class="term"><code class="literal">PANGO_GRAVITY_HINT_LINE</code></span></p></td>
225 <td> for scripts not in their natural direction (eg.
226 Latin in East gravity), choose per-script gravity such that every script
227 respects the line progression.  This means, Latin and Arabic will take
228 opposite gravities and both flow top-to-bottom for example.
229 </td>
230 </tr>
231 </tbody>
232 </table></div>
233 <p class="since">Since 1.16</p>
234 </div>
235 <hr>
236 <div class="refsect2" lang="en">
237 <a name="PANGO-GRAVITY-IS-VERTICAL--CAPS"></a><h3>PANGO_GRAVITY_IS_VERTICAL()</h3>
238 <pre class="programlisting">#define             PANGO_GRAVITY_IS_VERTICAL(gravity)</pre>
239 <p>
240 Whether a <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="type">PangoGravity</span></a> represents vertical writing directions.</p>
241 <p>
242 </p>
243 <div class="variablelist"><table border="0">
244 <col align="left" valign="top">
245 <tbody><tr>
246 <td><p><span class="term"><em class="parameter"><code>gravity</code></em> :</span></p></td>
247 <td> the <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="type">PangoGravity</span></a> to check
248 </td>
249 </tr></tbody>
250 </table></div>
251 <p class="since">Since 1.16</p>
252 </div>
253 <hr>
254 <div class="refsect2" lang="en">
255 <a name="pango-gravity-get-for-matrix"></a><h3>pango_gravity_get_for_matrix ()</h3>
256 <pre class="programlisting"><a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity">PangoGravity</a>        pango_gravity_get_for_matrix        (const <a class="link" href="pango-Glyph-Storage.html#PangoMatrix" title="PangoMatrix">PangoMatrix</a> *matrix);</pre>
257 <p>
258 Finds the gravity that best matches the rotation component
259 in a <a class="link" href="pango-Glyph-Storage.html#PangoMatrix" title="PangoMatrix"><span class="type">PangoMatrix</span></a>.</p>
260 <p>
261 </p>
262 <div class="variablelist"><table border="0">
263 <col align="left" valign="top">
264 <tbody>
265 <tr>
266 <td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
267 <td> a <a class="link" href="pango-Glyph-Storage.html#PangoMatrix" title="PangoMatrix"><span class="type">PangoMatrix</span></a>
268 </td>
269 </tr>
270 <tr>
271 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
272 <td> the gravity of <em class="parameter"><code>matrix</code></em>, which will never be
273 <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO--CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a>, or <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-SOUTH--CAPS"><code class="literal">PANGO_GRAVITY_SOUTH</code></a> if <em class="parameter"><code>matrix</code></em> is <a
274 href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
275 ><code class="literal">NULL</code></a>
276
277 </td>
278 </tr>
279 </tbody>
280 </table></div>
281 <p class="since">Since 1.16</p>
282 </div>
283 <hr>
284 <div class="refsect2" lang="en">
285 <a name="pango-gravity-get-for-script"></a><h3>pango_gravity_get_for_script ()</h3>
286 <pre class="programlisting"><a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity">PangoGravity</a>        pango_gravity_get_for_script        (<a class="link" href="pango-Scripts-and-Languages.html#PangoScript" title="enum PangoScript">PangoScript</a> script,
287                                                          <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity">PangoGravity</a> base_gravity,
288                                                          <a class="link" href="pango-Vertical-Text.html#PangoGravityHint" title="enum PangoGravityHint">PangoGravityHint</a> hint);</pre>
289 <p>
290 Based on the script, base gravity, and hint, returns actual gravity
291 to use in laying out a single <a class="link" href="pango-Text-Processing.html#PangoItem" title="PangoItem"><span class="type">PangoItem</span></a>.
292 </p>
293 <p>
294 If <em class="parameter"><code>base_gravity</code></em> is <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO--CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a>, it is first replaced with the
295 preferred gravity of <em class="parameter"><code>script</code></em>.  To get the preferred gravity of a script,
296 pass <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO--CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a> and <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-HINT-STRONG--CAPS"><code class="literal">PANGO_GRAVITY_HINT_STRONG</code></a> in.</p>
297 <p>
298 </p>
299 <div class="variablelist"><table border="0">
300 <col align="left" valign="top">
301 <tbody>
302 <tr>
303 <td><p><span class="term"><em class="parameter"><code>script</code></em> :</span></p></td>
304 <td> <a class="link" href="pango-Scripts-and-Languages.html#PangoScript" title="enum PangoScript"><span class="type">PangoScript</span></a> to query
305 </td>
306 </tr>
307 <tr>
308 <td><p><span class="term"><em class="parameter"><code>base_gravity</code></em> :</span></p></td>
309 <td> base gravity of the paragraph
310 </td>
311 </tr>
312 <tr>
313 <td><p><span class="term"><em class="parameter"><code>hint</code></em> :</span></p></td>
314 <td> orientation hint
315 </td>
316 </tr>
317 <tr>
318 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
319 <td> resolved gravity suitable to use for a run of text
320 with <em class="parameter"><code>script</code></em>.
321
322 </td>
323 </tr>
324 </tbody>
325 </table></div>
326 <p class="since">Since 1.16</p>
327 </div>
328 <hr>
329 <div class="refsect2" lang="en">
330 <a name="pango-gravity-get-for-script-and-width"></a><h3>pango_gravity_get_for_script_and_width ()</h3>
331 <pre class="programlisting"><a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity">PangoGravity</a>        pango_gravity_get_for_script_and_width
332                                                         (<a class="link" href="pango-Scripts-and-Languages.html#PangoScript" title="enum PangoScript">PangoScript</a> script,
333                                                          <a
334 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
335 >gboolean</a> wide,
336                                                          <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity">PangoGravity</a> base_gravity,
337                                                          <a class="link" href="pango-Vertical-Text.html#PangoGravityHint" title="enum PangoGravityHint">PangoGravityHint</a> hint);</pre>
338 <p>
339 Based on the script, East Asian width, base gravity, and hint,
340 returns actual gravity to use in laying out a single character
341 or <a class="link" href="pango-Text-Processing.html#PangoItem" title="PangoItem"><span class="type">PangoItem</span></a>.
342 </p>
343 <p>
344 This function is similar to <a class="link" href="pango-Vertical-Text.html#pango-gravity-get-for-script" title="pango_gravity_get_for_script ()"><code class="function">pango_gravity_get_for_script()</code></a> except
345 that this function makes a distinction between narrow/half-width and
346 wide/full-width characters also.  Wide/full-width characters always
347 stand <span style="color: red">&lt;emph&gt;upright&lt;/emph&gt;</span>, that is, they always take the base gravity,
348 whereas narrow/full-width characters are always rotated in vertical
349 context.
350 </p>
351 <p>
352 If <em class="parameter"><code>base_gravity</code></em> is <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO--CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a>, it is first replaced with the
353 preferred gravity of <em class="parameter"><code>script</code></em>.</p>
354 <p>
355 </p>
356 <div class="variablelist"><table border="0">
357 <col align="left" valign="top">
358 <tbody>
359 <tr>
360 <td><p><span class="term"><em class="parameter"><code>script</code></em> :</span></p></td>
361 <td> <a class="link" href="pango-Scripts-and-Languages.html#PangoScript" title="enum PangoScript"><span class="type">PangoScript</span></a> to query
362 </td>
363 </tr>
364 <tr>
365 <td><p><span class="term"><em class="parameter"><code>wide</code></em> :</span></p></td>
366 <td> <a
367 href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
368 ><code class="literal">TRUE</code></a> for wide characters as returned by <a
369 href="http://library.gnome.org/devel/glib/unstable/glib-Unicode-Manipulation.html#g-unichar-iswide"
370 ><code class="function">g_unichar_iswide()</code></a>
371 </td>
372 </tr>
373 <tr>
374 <td><p><span class="term"><em class="parameter"><code>base_gravity</code></em> :</span></p></td>
375 <td> base gravity of the paragraph
376 </td>
377 </tr>
378 <tr>
379 <td><p><span class="term"><em class="parameter"><code>hint</code></em> :</span></p></td>
380 <td> orientation hint
381 </td>
382 </tr>
383 <tr>
384 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
385 <td> resolved gravity suitable to use for a run of text
386 with <em class="parameter"><code>script</code></em> and <em class="parameter"><code>wide</code></em>.
387
388 </td>
389 </tr>
390 </tbody>
391 </table></div>
392 <p class="since">Since 1.26</p>
393 </div>
394 <hr>
395 <div class="refsect2" lang="en">
396 <a name="pango-gravity-to-rotation"></a><h3>pango_gravity_to_rotation ()</h3>
397 <pre class="programlisting">double              pango_gravity_to_rotation           (<a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity">PangoGravity</a> gravity);</pre>
398 <p>
399 Converts a <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="type">PangoGravity</span></a> value to its natural rotation in radians.
400 <em class="parameter"><code>gravity</code></em> should not be <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO--CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a>.
401 </p>
402 <p>
403 Note that <a class="link" href="pango-Glyph-Storage.html#pango-matrix-rotate" title="pango_matrix_rotate ()"><code class="function">pango_matrix_rotate()</code></a> takes angle in degrees, not radians.
404 So, to call <a class="link" href="pango-Glyph-Storage.html#pango-matrix-rotate" title="pango_matrix_rotate ()"><code class="function">pango_matrix_rotate()</code></a> with the output of this function
405 you should multiply it by (180. / G_PI).</p>
406 <p>
407 </p>
408 <div class="variablelist"><table border="0">
409 <col align="left" valign="top">
410 <tbody>
411 <tr>
412 <td><p><span class="term"><em class="parameter"><code>gravity</code></em> :</span></p></td>
413 <td> gravity to query
414 </td>
415 </tr>
416 <tr>
417 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
418 <td> the rotation value corresponding to <em class="parameter"><code>gravity</code></em>.
419
420 </td>
421 </tr>
422 </tbody>
423 </table></div>
424 <p class="since">Since 1.16</p>
425 </div>
426 </div>
427 <div class="refsect1" lang="en">
428 <a name="pango-Vertical-Text.see-also"></a><h2>See Also</h2>
429 <p>
430 <a class="link" href="pango-Text-Processing.html#pango-context-get-base-gravity" title="pango_context_get_base_gravity ()"><code class="function">pango_context_get_base_gravity()</code></a>,
431 <a class="link" href="pango-Text-Processing.html#pango-context-set-base-gravity" title="pango_context_set_base_gravity ()"><code class="function">pango_context_set_base_gravity()</code></a>,
432 <a class="link" href="pango-Text-Processing.html#pango-context-get-gravity" title="pango_context_get_gravity ()"><code class="function">pango_context_get_gravity()</code></a>,
433 <a class="link" href="pango-Text-Processing.html#pango-context-get-gravity-hint" title="pango_context_get_gravity_hint ()"><code class="function">pango_context_get_gravity_hint()</code></a>,
434 <a class="link" href="pango-Text-Processing.html#pango-context-set-gravity-hint" title="pango_context_set_gravity_hint ()"><code class="function">pango_context_set_gravity_hint()</code></a>,
435 <a class="link" href="pango-Fonts.html#pango-font-description-set-gravity" title="pango_font_description_set_gravity ()"><code class="function">pango_font_description_set_gravity()</code></a>,
436 <a class="link" href="pango-Fonts.html#pango-font-description-get-gravity" title="pango_font_description_get_gravity ()"><code class="function">pango_font_description_get_gravity()</code></a>,
437 <a class="link" href="pango-Text-Attributes.html#pango-attr-gravity-new" title="pango_attr_gravity_new ()"><code class="function">pango_attr_gravity_new()</code></a>,
438 <a class="link" href="pango-Text-Attributes.html#pango-attr-gravity-hint-new" title="pango_attr_gravity_hint_new ()"><code class="function">pango_attr_gravity_hint_new()</code></a>
439 </p>
440 </div>
441 </div>
442 <div class="footer">
443 <hr>
444           Generated by GTK-Doc V1.11</div>
445 </body>
446 </html>