Current File : //usr/share/gtk-doc/html/pango/pango-Vertical-Text.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Vertical Text: Pango Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Pango Reference Manual">
<link rel="up" href="pango.html" title="Basic Pango Interfaces">
<link rel="prev" href="pango-Bidirectional-Text.html" title="Bidirectional Text">
<link rel="next" href="rendering.html" title="Rendering with Pango">
<meta name="generator" content="GTK-Doc V1.28 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#pango-Vertical-Text.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#pango-Vertical-Text.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="pango.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="pango-Bidirectional-Text.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="rendering.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="pango-Vertical-Text"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="pango-Vertical-Text.top_of_page"></a>Vertical Text</span></h2>
<p>Vertical Text — Laying text out in vertical directions</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="pango-Vertical-Text.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-IS-IMPROPER:CAPS" title="PANGO_GRAVITY_IS_IMPROPER()">PANGO_GRAVITY_IS_IMPROPER</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-IS-VERTICAL:CAPS" title="PANGO_GRAVITY_IS_VERTICAL()">PANGO_GRAVITY_IS_VERTICAL</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="returnvalue">PangoGravity</span></a>
</td>
<td class="function_name">
<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> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="returnvalue">PangoGravity</span></a>
</td>
<td class="function_name">
<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> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="returnvalue">PangoGravity</span></a>
</td>
<td class="function_name">
<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> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">double</span>
</td>
<td class="function_name">
<a class="link" href="pango-Vertical-Text.html#pango-gravity-to-rotation" title="pango_gravity_to_rotation ()">pango_gravity_to_rotation</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="pango-Vertical-Text.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity">PangoGravity</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="pango-Vertical-Text.html#PangoGravityHint" title="enum PangoGravityHint">PangoGravityHint</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="pango-Vertical-Text.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    <a href="/usr/share/gtk-doc/html/gobject/gobject-Enumeration-and-Flag-Types.html">GEnum</a>
    <span class="lineart">├──</span> PangoGravity
    <span class="lineart">╰──</span> PangoGravityHint
</pre>
</div>
<div class="refsect1">
<a name="pango-Vertical-Text.description"></a><h2>Description</h2>
<p>Since 1.16, Pango is able to correctly lay vertical text out.  In fact, it can
set layouts of mixed vertical and non-vertical text.  This section describes
the types used for setting vertical text parameters.</p>
<p>The way this is implemented is through the concept of
<em class="firstterm">gravity</em>.  Gravity of normal Latin text is south.  A
gravity value of east means that glyphs will be rotated ninety degrees
counterclockwise.  So, to render vertical text one needs to set the gravity
and rotate the layout using the matrix machinery already in place.  This has
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
any change as the assumption that lines run in the X direction and stack in
the Y direction holds even for vertical text layouts.</p>
<p>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
let Pango decide the gravity assigned to each run of text.  This automatically
handles text with mixed scripts.  A very common use is to set the context base
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>
and rotate the layout normally.  Pango will make sure that
Asian languages take the right form, while other scripts are rotated normally.</p>
<p>The correct way to set gravity on a layout is to set it on the context
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
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
set base gravity of the context can be accessed using
<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>
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
the same as the base gravity for the most part, except that if the base
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
on the current matrix set on context, and is derived using
<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>.</p>
<p>The next thing an application may want to set on the context is the
<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
different scripts should react to the set base gravity.</p>
<p>Font descriptions have a gravity property too, that can be set using
<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
<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
from application code and are mainly used by <a class="link" href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> internally.</p>
<p>Last but not least, one can create <a class="link" href="pango-Text-Attributes.html#PangoAttribute" title="struct PangoAttribute"><span class="type">PangoAttribute</span></a>s for gravity
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
<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>.</p>
</div>
<div class="refsect1">
<a name="pango-Vertical-Text.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="PANGO-GRAVITY-IS-IMPROPER:CAPS"></a><h3>PANGO_GRAVITY_IS_IMPROPER()</h3>
<pre class="programlisting">#define             PANGO_GRAVITY_IS_IMPROPER(gravity)</pre>
<p>Whether a <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="type">PangoGravity</span></a> represents a gravity that results in reversal of text direction.</p>
<div class="refsect3">
<a name="PANGO-GRAVITY-IS-IMPROPER.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>gravity</p></td>
<td class="parameter_description"><p>the <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="type">PangoGravity</span></a> to check</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="PANGO-GRAVITY-IS-IMPROPER.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if <em class="parameter"><code>gravity</code></em>
is <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-WEST:CAPS"><code class="literal">PANGO_GRAVITY_WEST</code></a> or <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-NORTH:CAPS"><code class="literal">PANGO_GRAVITY_NORTH</code></a>,
<code class="literal">FALSE</code> otherwise.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-1-32.html#api-index-1.32">1.32</a></p>
</div>
<hr>
<div class="refsect2">
<a name="PANGO-GRAVITY-IS-VERTICAL:CAPS"></a><h3>PANGO_GRAVITY_IS_VERTICAL()</h3>
<pre class="programlisting">#define             PANGO_GRAVITY_IS_VERTICAL(gravity)</pre>
<p>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>
<div class="refsect3">
<a name="PANGO-GRAVITY-IS-VERTICAL.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>gravity</p></td>
<td class="parameter_description"><p>the <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="type">PangoGravity</span></a> to check</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="PANGO-GRAVITY-IS-VERTICAL.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if <em class="parameter"><code>gravity</code></em>
is <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-EAST:CAPS"><code class="literal">PANGO_GRAVITY_EAST</code></a> or <a class="link" href="pango-Vertical-Text.html#PANGO-GRAVITY-WEST:CAPS"><code class="literal">PANGO_GRAVITY_WEST</code></a>,
<code class="literal">FALSE</code> otherwise.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-1-16.html#api-index-1.16">1.16</a></p>
</div>
<hr>
<div class="refsect2">
<a name="pango-gravity-get-for-matrix"></a><h3>pango_gravity_get_for_matrix ()</h3>
<pre class="programlisting"><a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="returnvalue">PangoGravity</span></a>
pango_gravity_get_for_matrix (<em class="parameter"><code>const <a class="link" href="pango-Glyph-Storage.html#PangoMatrix"><span class="type">PangoMatrix</span></a> *matrix</code></em>);</pre>
<p>Finds the gravity that best matches the rotation component
in a <a class="link" href="pango-Glyph-Storage.html#PangoMatrix"><span class="type">PangoMatrix</span></a>.</p>
<div class="refsect3">
<a name="pango-gravity-get-for-matrix.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>matrix</p></td>
<td class="parameter_description"><p>a <a class="link" href="pango-Glyph-Storage.html#PangoMatrix"><span class="type">PangoMatrix</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="pango-gravity-get-for-matrix.returns"></a><h4>Returns</h4>
<p> the gravity of <em class="parameter"><code>matrix</code></em>
, which will never be
<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 <code class="literal">NULL</code></p>
</div>
<p class="since">Since: <a class="link" href="api-index-1-16.html#api-index-1.16">1.16</a></p>
</div>
<hr>
<div class="refsect2">
<a name="pango-gravity-get-for-script"></a><h3>pango_gravity_get_for_script ()</h3>
<pre class="programlisting"><a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="returnvalue">PangoGravity</span></a>
pango_gravity_get_for_script (<em class="parameter"><code><a class="link" href="pango-Scripts-and-Languages.html#PangoScript" title="enum PangoScript"><span class="type">PangoScript</span></a> script</code></em>,
                              <em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="type">PangoGravity</span></a> base_gravity</code></em>,
                              <em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravityHint" title="enum PangoGravityHint"><span class="type">PangoGravityHint</span></a> hint</code></em>);</pre>
<p>Based on the script, base gravity, and hint, returns actual gravity
to use in laying out a single <a class="link" href="pango-Text-Processing.html#PangoItem"><span class="type">PangoItem</span></a>.</p>
<p>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
preferred gravity of <em class="parameter"><code>script</code></em>
.  To get the preferred gravity of a script,
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>
<div class="refsect3">
<a name="pango-gravity-get-for-script.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>script</p></td>
<td class="parameter_description"><p><a class="link" href="pango-Scripts-and-Languages.html#PangoScript" title="enum PangoScript"><span class="type">PangoScript</span></a> to query</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>base_gravity</p></td>
<td class="parameter_description"><p>base gravity of the paragraph</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hint</p></td>
<td class="parameter_description"><p>orientation hint</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="pango-gravity-get-for-script.returns"></a><h4>Returns</h4>
<p> resolved gravity suitable to use for a run of text
with <em class="parameter"><code>script</code></em>
.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-1-16.html#api-index-1.16">1.16</a></p>
</div>
<hr>
<div class="refsect2">
<a name="pango-gravity-get-for-script-and-width"></a><h3>pango_gravity_get_for_script_and_width ()</h3>
<pre class="programlisting"><a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="returnvalue">PangoGravity</span></a>
pango_gravity_get_for_script_and_width
                               (<em class="parameter"><code><a class="link" href="pango-Scripts-and-Languages.html#PangoScript" title="enum PangoScript"><span class="type">PangoScript</span></a> script</code></em>,
                                <em class="parameter"><code><span class="type">gboolean</span> wide</code></em>,
                                <em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="type">PangoGravity</span></a> base_gravity</code></em>,
                                <em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravityHint" title="enum PangoGravityHint"><span class="type">PangoGravityHint</span></a> hint</code></em>);</pre>
<p>Based on the script, East Asian width, base gravity, and hint,
returns actual gravity to use in laying out a single character
or <a class="link" href="pango-Text-Processing.html#PangoItem"><span class="type">PangoItem</span></a>.</p>
<p>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
that this function makes a distinction between narrow/half-width and
wide/full-width characters also.  Wide/full-width characters always
stand <span class="emphasis"><em>upright</em></span>, that is, they always take the base gravity,
whereas narrow/full-width characters are always rotated in vertical
context.</p>
<p>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
preferred gravity of <em class="parameter"><code>script</code></em>
.</p>
<div class="refsect3">
<a name="pango-gravity-get-for-script-and-width.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>script</p></td>
<td class="parameter_description"><p><a class="link" href="pango-Scripts-and-Languages.html#PangoScript" title="enum PangoScript"><span class="type">PangoScript</span></a> to query</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>wide</p></td>
<td class="parameter_description"><p><code class="literal">TRUE</code> for wide characters as returned by <code class="function">g_unichar_iswide()</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>base_gravity</p></td>
<td class="parameter_description"><p>base gravity of the paragraph</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hint</p></td>
<td class="parameter_description"><p>orientation hint</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="pango-gravity-get-for-script-and-width.returns"></a><h4>Returns</h4>
<p> resolved gravity suitable to use for a run of text
with <em class="parameter"><code>script</code></em>
and <em class="parameter"><code>wide</code></em>
.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-1-26.html#api-index-1.26">1.26</a></p>
</div>
<hr>
<div class="refsect2">
<a name="pango-gravity-to-rotation"></a><h3>pango_gravity_to_rotation ()</h3>
<pre class="programlisting"><span class="returnvalue">double</span>
pango_gravity_to_rotation (<em class="parameter"><code><a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="type">PangoGravity</span></a> gravity</code></em>);</pre>
<p>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.
<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>.</p>
<p>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.
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
you should multiply it by (180. / G_PI).</p>
<div class="refsect3">
<a name="pango-gravity-to-rotation.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>gravity</p></td>
<td class="parameter_description"><p>gravity to query</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="pango-gravity-to-rotation.returns"></a><h4>Returns</h4>
<p> the rotation value corresponding to <em class="parameter"><code>gravity</code></em>
.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-1-16.html#api-index-1.16">1.16</a></p>
</div>
</div>
<div class="refsect1">
<a name="pango-Vertical-Text.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="PangoGravity"></a><h3>enum PangoGravity</h3>
<p>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
of text.  This is useful when rendering vertical text layouts.  In
those situations, the layout is rotated using a non-identity PangoMatrix,
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>.
Not every value in this enumeration makes sense for every usage of
<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
<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
<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>.</p>
<p>See also: <a class="link" href="pango-Vertical-Text.html#PangoGravityHint" title="enum PangoGravityHint"><span class="type">PangoGravityHint</span></a></p>
<div class="refsect3">
<a name="PangoGravity.members"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="PANGO-GRAVITY-SOUTH:CAPS"></a>PANGO_GRAVITY_SOUTH</p></td>
<td class="enum_member_description">
<p>Glyphs stand upright (default)</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="PANGO-GRAVITY-EAST:CAPS"></a>PANGO_GRAVITY_EAST</p></td>
<td class="enum_member_description">
<p>Glyphs are rotated 90 degrees clockwise</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="PANGO-GRAVITY-NORTH:CAPS"></a>PANGO_GRAVITY_NORTH</p></td>
<td class="enum_member_description">
<p>Glyphs are upside-down</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="PANGO-GRAVITY-WEST:CAPS"></a>PANGO_GRAVITY_WEST</p></td>
<td class="enum_member_description">
<p>Glyphs are rotated 90 degrees counter-clockwise</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="PANGO-GRAVITY-AUTO:CAPS"></a>PANGO_GRAVITY_AUTO</p></td>
<td class="enum_member_description">
<p>Gravity is resolved from the context matrix</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-1-16.html#api-index-1.16">1.16</a></p>
</div>
<hr>
<div class="refsect2">
<a name="PangoGravityHint"></a><h3>enum PangoGravityHint</h3>
<p>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
vertical context.  That is, English excerpt in a vertical paragraph for
example.</p>
<p>See <a class="link" href="pango-Vertical-Text.html#PangoGravity" title="enum PangoGravity"><span class="type">PangoGravity</span></a>.</p>
<div class="refsect3">
<a name="PangoGravityHint.members"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="PANGO-GRAVITY-HINT-NATURAL:CAPS"></a>PANGO_GRAVITY_HINT_NATURAL</p></td>
<td class="enum_member_description">
<p>scripts will take their natural gravity based
on the base gravity and the script.  This is the default.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="PANGO-GRAVITY-HINT-STRONG:CAPS"></a>PANGO_GRAVITY_HINT_STRONG</p></td>
<td class="enum_member_description">
<p>always use the base gravity set, regardless of
the script.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="PANGO-GRAVITY-HINT-LINE:CAPS"></a>PANGO_GRAVITY_HINT_LINE</p></td>
<td class="enum_member_description">
<p>for scripts not in their natural direction (eg.
Latin in East gravity), choose per-script gravity such that every script
respects the line progression.  This means, Latin and Arabic will take
opposite gravities and both flow top-to-bottom for example.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-1-16.html#api-index-1.16">1.16</a></p>
</div>
</div>
<div class="refsect1">
<a name="pango-Vertical-Text.see-also"></a><h2>See Also</h2>
<p>pango_context_get_base_gravity(),
<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>,
<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>,
<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>,
<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>,
<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>,
<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>,
<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>,
<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></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.28</div>
</body>
</html>