1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5
<title>Vertical Text</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
7
<link rel="start" href="index.html" title="Pango Reference Manual">
8
<link rel="up" href="pango.html" title="Basic Pango Interfaces">
9
<link rel="prev" href="pango-Scripts.html" title="Scripts">
10
<link rel="next" href="rendering.html" title="Rendering with Pango">
11
<meta name="generator" content="GTK-Doc V1.6 (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="index" href="ix01.html" title="Index">
18
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
19
<link rel="index" href="ix03.html" title="Index of new symbols in 1.2">
20
<link rel="index" href="ix04.html" title="Index of new symbols in 1.4">
21
<link rel="index" href="ix05.html" title="Index of new symbols in 1.6">
22
<link rel="index" href="ix06.html" title="Index of new symbols in 1.8">
23
<link rel="index" href="ix07.html" title="Index of new symbols in 1.10">
24
<link rel="index" href="ix08.html" title="Index of new symbols in 1.12">
25
<link rel="index" href="ix09.html" title="Index of new symbols in 1.14">
26
<link rel="index" href="ix10.html" title="Index of new symbols in 1.16">
28
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
29
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
31
<td><a accesskey="p" href="pango-Scripts.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
32
<td><a accesskey="u" href="pango.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
33
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
34
<th width="100%" align="center">Pango Reference Manual</th>
35
<td><a accesskey="n" href="rendering.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
37
<tr><td colspan="5" class="shortcuts"><nobr><a href="#top_of_page" class="shortcut">Top</a>
39
<a href="#desc" class="shortcut">Description</a></nobr></td></tr>
41
<div class="refentry" lang="en">
42
<a name="pango-Vertical-Text"></a><div class="titlepage"></div>
43
<div class="refnamediv"><table width="100%"><tr>
45
<h2><span class="refentrytitle"><a name="top_of_page"></a>Vertical Text</span></h2>
46
<p>Vertical Text — Laying text out in vertical directions</p>
48
<td valign="top" align="right"></td>
50
<div class="refsynopsisdiv">
51
<a name="synopsis"></a><h2>Synopsis</h2>
52
<pre class="synopsis">
56
enum <a href="pango-Vertical-Text.html#PangoGravity">PangoGravity</a>;
57
#define <a href="pango-Vertical-Text.html#PANGO-TYPE-GRAVITY:CAPS">PANGO_TYPE_GRAVITY</a>
58
enum <a href="pango-Vertical-Text.html#PangoGravityHint">PangoGravityHint</a>;
59
#define <a href="pango-Vertical-Text.html#PANGO-TYPE-GRAVITY-HINT:CAPS">PANGO_TYPE_GRAVITY_HINT</a>
60
#define <a href="pango-Vertical-Text.html#PANGO-GRAVITY-IS-VERTICAL:CAPS">PANGO_GRAVITY_IS_VERTICAL</a> (gravity)
61
<a href="pango-Vertical-Text.html#PangoGravity">PangoGravity</a> <a href="pango-Vertical-Text.html#pango-gravity-get-for-matrix">pango_gravity_get_for_matrix</a> (const <a href="pango-Glyph-Storage.html#PangoMatrix">PangoMatrix</a> *matrix);
62
<a href="pango-Vertical-Text.html#PangoGravity">PangoGravity</a> <a href="pango-Vertical-Text.html#pango-gravity-get-for-script">pango_gravity_get_for_script</a> (<a href="pango-Scripts.html#PangoScript">PangoScript</a> script,
63
<a href="pango-Vertical-Text.html#PangoGravity">PangoGravity</a> base_gravity,
64
<a href="pango-Vertical-Text.html#PangoGravityHint">PangoGravityHint</a> hint);
68
<div class="refsect1" lang="en">
69
<a name="desc"></a><h2>Description</h2>
71
Since 1.16, Pango is able to correctly lay vertical text out. In fact, it can
72
set layouts of mixed vertical and non-vertical text. This section describes
73
the types used for setting vertical text parameters.
76
<div class="refsect1" lang="en">
77
<a name="details"></a><h2>Details</h2>
78
<div class="refsect2" lang="en">
79
<a name="id3125692"></a><h3>
80
<a name="PangoGravity"></a>enum PangoGravity</h3>
81
<a class="indexterm" name="id3125705"></a><pre class="programlisting">typedef enum {
90
The <a href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a> type represents the orientation of glyphs in a segment
91
of text. This is useful when rendering vertical text layouts. In
92
those situations, the layout is rotated using a non-identity PangoMatrix,
93
and then glyph orientation is controlled using <a href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a>.
94
Not every value in this enumeration makes sense for every usage of
95
<a href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a>; for example, <a href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO:CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a> only can be passed to
96
<a href="pango-Text-Processing.html#pango-context-set-base-gravity"><code class="function">pango_context_set_base_gravity()</code></a> and can only be returned by
97
<a href="pango-Text-Processing.html#pango-context-get-base-gravity"><code class="function">pango_context_get_base_gravity()</code></a>.
100
See also: <a href="pango-Vertical-Text.html#PangoGravityHint"><span class="type">PangoGravityHint</span></a></p>
104
<div class="variablelist"><table border="0">
105
<col align="left" valign="top">
109
<span class="term"><a name="PANGO-GRAVITY-SOUTH:CAPS"></a><code class="literal">PANGO_GRAVITY_SOUTH</code></span></td>
110
<td> Glyphs stand upright (default)
115
<span class="term"><a name="PANGO-GRAVITY-EAST:CAPS"></a><code class="literal">PANGO_GRAVITY_EAST</code></span></td>
116
<td> Glyphs are rotated 90 degrees clockwise
121
<span class="term"><a name="PANGO-GRAVITY-NORTH:CAPS"></a><code class="literal">PANGO_GRAVITY_NORTH</code></span></td>
122
<td> Glyphs are upside-down
127
<span class="term"><a name="PANGO-GRAVITY-WEST:CAPS"></a><code class="literal">PANGO_GRAVITY_WEST</code></span></td>
128
<td> Glyphs are rotated 90 degrees counter-clockwise
133
<span class="term"><a name="PANGO-GRAVITY-AUTO:CAPS"></a><code class="literal">PANGO_GRAVITY_AUTO</code></span></td>
134
<td> Gravity is resolved from the context matrix
143
<div class="refsect2" lang="en">
144
<a name="id3125924"></a><h3>
145
<a name="PANGO-TYPE-GRAVITY:CAPS"></a>PANGO_TYPE_GRAVITY</h3>
146
<a class="indexterm" name="id3125937"></a><pre class="programlisting">#define PANGO_TYPE_GRAVITY (pango_gravity_get_type())
150
href="../gobject/gobject-The-Base-Object-Type.html#GObject"
151
><span class="type">GObject</span></a> type for <a href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a>.
155
<div class="refsect2" lang="en">
156
<a name="id3125970"></a><h3>
157
<a name="PangoGravityHint"></a>enum PangoGravityHint</h3>
158
<a class="indexterm" name="id3125985"></a><pre class="programlisting">typedef enum {
159
PANGO_GRAVITY_HINT_NATURAL,
160
PANGO_GRAVITY_HINT_STRONG,
161
PANGO_GRAVITY_HINT_LINE
165
The <a href="pango-Vertical-Text.html#PangoGravityHint"><span class="type">PangoGravityHint</span></a> defines how horizontal scripts should behave in a
166
vertical context. That is, English excerpt in a vertical paragraph for
170
See <a href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a>.</p>
174
<div class="variablelist"><table border="0">
175
<col align="left" valign="top">
179
<span class="term"><a name="PANGO-GRAVITY-HINT-NATURAL:CAPS"></a><code class="literal">PANGO_GRAVITY_HINT_NATURAL</code></span></td>
180
<td> scripts will take their natural gravity based
181
on the base gravity and the script. This is the default.
186
<span class="term"><a name="PANGO-GRAVITY-HINT-STRONG:CAPS"></a><code class="literal">PANGO_GRAVITY_HINT_STRONG</code></span></td>
187
<td> always use the base gravity set, regardless of
193
<span class="term"><a name="PANGO-GRAVITY-HINT-LINE:CAPS"></a><code class="literal">PANGO_GRAVITY_HINT_LINE</code></span></td>
194
<td> for scripts not in their natural direction (eg.
195
Latin in East gravity), choose per-script gravity such that every script
196
respects the line progression. This means, Latin and Arabic will take
197
opposite gravities and both flow top-to-bottom for example.
206
<div class="refsect2" lang="en">
207
<a name="id3126112"></a><h3>
208
<a name="PANGO-TYPE-GRAVITY-HINT:CAPS"></a>PANGO_TYPE_GRAVITY_HINT</h3>
209
<a class="indexterm" name="id3126126"></a><pre class="programlisting">#define PANGO_TYPE_GRAVITY_HINT (pango_gravity_hint_get_type())
213
href="../gobject/gobject-The-Base-Object-Type.html#GObject"
214
><span class="type">GObject</span></a> type for <a href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a>.
218
<div class="refsect2" lang="en">
219
<a name="id3126158"></a><h3>
220
<a name="PANGO-GRAVITY-IS-VERTICAL:CAPS"></a>PANGO_GRAVITY_IS_VERTICAL()</h3>
221
<a class="indexterm" name="id3126174"></a><pre class="programlisting">#define PANGO_GRAVITY_IS_VERTICAL(gravity)</pre>
223
Whether a <a href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a> represents vertical writing directions.</p>
227
<div class="variablelist"><table border="0">
228
<col align="left" valign="top">
231
<span class="term"><em class="parameter"><code>gravity</code></em> :</span></td>
232
<td> the <a href="pango-Vertical-Text.html#PangoGravity"><span class="type">PangoGravity</span></a> to check
240
<div class="refsect2" lang="en">
241
<a name="id3126233"></a><h3>
242
<a name="pango-gravity-get-for-matrix"></a>pango_gravity_get_for_matrix ()</h3>
243
<a class="indexterm" name="id3126249"></a><pre class="programlisting"><a href="pango-Vertical-Text.html#PangoGravity">PangoGravity</a> pango_gravity_get_for_matrix (const <a href="pango-Glyph-Storage.html#PangoMatrix">PangoMatrix</a> *matrix);</pre>
245
Finds the gravity that best matches the rotation component
246
in a <a href="pango-Glyph-Storage.html#PangoMatrix"><span class="type">PangoMatrix</span></a>.</p>
250
<div class="variablelist"><table border="0">
251
<col align="left" valign="top">
255
<span class="term"><em class="parameter"><code>matrix</code></em> :</span></td>
256
<td> a <a href="pango-Glyph-Storage.html#PangoMatrix"><span class="type">PangoMatrix</span></a>
261
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
262
<td> the gravity of <em class="parameter"><code>matrix</code></em>, which will never be
263
<a href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO:CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a>, or <a 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
264
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
265
><code class="literal">NULL</code></a>
275
<div class="refsect2" lang="en">
276
<a name="id3126376"></a><h3>
277
<a name="pango-gravity-get-for-script"></a>pango_gravity_get_for_script ()</h3>
278
<a class="indexterm" name="id3126391"></a><pre class="programlisting"><a href="pango-Vertical-Text.html#PangoGravity">PangoGravity</a> pango_gravity_get_for_script (<a href="pango-Scripts.html#PangoScript">PangoScript</a> script,
279
<a href="pango-Vertical-Text.html#PangoGravity">PangoGravity</a> base_gravity,
280
<a href="pango-Vertical-Text.html#PangoGravityHint">PangoGravityHint</a> hint);</pre>
282
Based on the script, base gravity, and hint, returns actual gravity
283
to use in laying out a single <a href="pango-Text-Processing.html#PangoItem"><span class="type">PangoItem</span></a>.
286
If <em class="parameter"><code>base_gravity</code></em> is <a href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO:CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a>, it is first replaced with the
287
preferred gravity of <em class="parameter"><code>script</code></em>. To get the preferred gravity of a script,
288
pass <a href="pango-Vertical-Text.html#PANGO-GRAVITY-AUTO:CAPS"><code class="literal">PANGO_GRAVITY_AUTO</code></a> and <a href="pango-Vertical-Text.html#PANGO-GRAVITY-HINT-STRONG:CAPS"><code class="literal">PANGO_GRAVITY_HINT_STRONG</code></a> in.</p>
292
<div class="variablelist"><table border="0">
293
<col align="left" valign="top">
297
<span class="term"><em class="parameter"><code>script</code></em> :</span></td>
298
<td> <a href="pango-Scripts.html#PangoScript"><span class="type">PangoScript</span></a> to query
303
<span class="term"><em class="parameter"><code>base_gravity</code></em> :</span></td>
304
<td> base gravity of the paragraph
309
<span class="term"><em class="parameter"><code>hint</code></em> :</span></td>
310
<td> orientation hint
315
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
316
<td> resolved gravity suitable to use for a run of text