<refentry id="pango-Glyph-Storage">
<refmeta>
<refentrytitle role="top_of_page">Glyph Storage</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>PANGO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Glyph Storage</refname>
<refpurpose>Structures for storing information about glyphs</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>



#define             <link linkend="PANGO-SCALE:CAPS">PANGO_SCALE</link>
#define             <link linkend="PANGO-PIXELS:CAPS">PANGO_PIXELS</link>                        (d)
#define             <link linkend="PANGO-PIXELS-FLOOR:CAPS">PANGO_PIXELS_FLOOR</link>                  (d)
#define             <link linkend="PANGO-PIXELS-CEIL:CAPS">PANGO_PIXELS_CEIL</link>                   (d)
#define             <link linkend="PANGO-UNITS-ROUND:CAPS">PANGO_UNITS_ROUND</link>                   (d)
<link linkend="double">double</link>              <link linkend="pango-units-to-double">pango_units_to_double</link>               (<link linkend="int">int</link> i);
<link linkend="int">int</link>                 <link linkend="pango-units-from-double">pango_units_from_double</link>             (<link linkend="double">double</link> d);
                    <link linkend="PangoRectangle">PangoRectangle</link>;
#define             <link linkend="PANGO-ASCENT:CAPS">PANGO_ASCENT</link>                        (rect)
#define             <link linkend="PANGO-DESCENT:CAPS">PANGO_DESCENT</link>                       (rect)
#define             <link linkend="PANGO-LBEARING:CAPS">PANGO_LBEARING</link>                      (rect)
#define             <link linkend="PANGO-RBEARING:CAPS">PANGO_RBEARING</link>                      (rect)
<link linkend="void">void</link>                <link linkend="pango-extents-to-pixels">pango_extents_to_pixels</link>             (<link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);
                    <link linkend="PangoMatrix">PangoMatrix</link>;
#define             <link linkend="PANGO-TYPE-MATRIX:CAPS">PANGO_TYPE_MATRIX</link>
#define             <link linkend="PANGO-MATRIX-INIT:CAPS">PANGO_MATRIX_INIT</link>
<link linkend="PangoMatrix">PangoMatrix</link>*        <link linkend="pango-matrix-copy">pango_matrix_copy</link>                   (const <link linkend="PangoMatrix">PangoMatrix</link> *matrix);
<link linkend="void">void</link>                <link linkend="pango-matrix-free">pango_matrix_free</link>                   (<link linkend="PangoMatrix">PangoMatrix</link> *matrix);
<link linkend="void">void</link>                <link linkend="pango-matrix-translate">pango_matrix_translate</link>              (<link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         <link linkend="double">double</link> tx,
                                                         <link linkend="double">double</link> ty);
<link linkend="void">void</link>                <link linkend="pango-matrix-scale">pango_matrix_scale</link>                  (<link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         <link linkend="double">double</link> scale_x,
                                                         <link linkend="double">double</link> scale_y);
<link linkend="void">void</link>                <link linkend="pango-matrix-rotate">pango_matrix_rotate</link>                 (<link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         <link linkend="double">double</link> degrees);
<link linkend="void">void</link>                <link linkend="pango-matrix-concat">pango_matrix_concat</link>                 (<link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         const <link linkend="PangoMatrix">PangoMatrix</link> *new_matrix);
<link linkend="void">void</link>                <link linkend="pango-matrix-transform-point">pango_matrix_transform_point</link>        (const <link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         <link linkend="double">double</link> *x,
                                                         <link linkend="double">double</link> *y);
<link linkend="void">void</link>                <link linkend="pango-matrix-transform-distance">pango_matrix_transform_distance</link>     (const <link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         <link linkend="double">double</link> *dx,
                                                         <link linkend="double">double</link> *dy);
<link linkend="void">void</link>                <link linkend="pango-matrix-transform-rectangle">pango_matrix_transform_rectangle</link>    (const <link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *rect);
<link linkend="void">void</link>                <link linkend="pango-matrix-transform-pixel-rectangle">pango_matrix_transform_pixel_rectangle</link>
                                                        (const <link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *rect);
<link linkend="double">double</link>              <link linkend="pango-matrix-get-font-scale-factor">pango_matrix_get_font_scale_factor</link>  (const <link linkend="PangoMatrix">PangoMatrix</link> *matrix);
typedef             <link linkend="PangoGlyph">PangoGlyph</link>;
#define             <link linkend="PANGO-GLYPH-EMPTY:CAPS">PANGO_GLYPH_EMPTY</link>
#define             <link linkend="PANGO-GLYPH-UNKNOWN-FLAG:CAPS">PANGO_GLYPH_UNKNOWN_FLAG</link>
#define             <link linkend="PANGO-GET-UNKNOWN-GLYPH:CAPS">PANGO_GET_UNKNOWN_GLYPH</link>             (wc)
                    <link linkend="PangoGlyphInfo">PangoGlyphInfo</link>;
                    <link linkend="PangoGlyphGeometry">PangoGlyphGeometry</link>;
typedef             <link linkend="PangoGlyphUnit">PangoGlyphUnit</link>;
                    <link linkend="PangoGlyphVisAttr">PangoGlyphVisAttr</link>;
                    <link linkend="PangoGlyphString">PangoGlyphString</link>;
                    <link linkend="PangoGlyphItem">PangoGlyphItem</link>;
#define             <link linkend="PANGO-TYPE-GLYPH-STRING:CAPS">PANGO_TYPE_GLYPH_STRING</link>
<link linkend="PangoGlyphString">PangoGlyphString</link>*   <link linkend="pango-glyph-string-new">pango_glyph_string_new</link>              (void);
<link linkend="PangoGlyphString">PangoGlyphString</link>*   <link linkend="pango-glyph-string-copy">pango_glyph_string_copy</link>             (<link linkend="PangoGlyphString">PangoGlyphString</link> *string);
<link linkend="void">void</link>                <link linkend="pango-glyph-string-set-size">pango_glyph_string_set_size</link>         (<link linkend="PangoGlyphString">PangoGlyphString</link> *string,
                                                         <link linkend="gint">gint</link> new_len);
<link linkend="void">void</link>                <link linkend="pango-glyph-string-free">pango_glyph_string_free</link>             (<link linkend="PangoGlyphString">PangoGlyphString</link> *string);
<link linkend="void">void</link>                <link linkend="pango-glyph-string-extents">pango_glyph_string_extents</link>          (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs,
                                                         <link linkend="PangoFont">PangoFont</link> *font,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);
<link linkend="void">void</link>                <link linkend="pango-glyph-string-extents-range">pango_glyph_string_extents_range</link>    (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs,
                                                         <link linkend="int">int</link> start,
                                                         <link linkend="int">int</link> end,
                                                         <link linkend="PangoFont">PangoFont</link> *font,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);
<link linkend="int">int</link>                 <link linkend="pango-glyph-string-get-width">pango_glyph_string_get_width</link>        (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs);
<link linkend="void">void</link>                <link linkend="pango-glyph-string-index-to-x">pango_glyph_string_index_to_x</link>       (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs,
                                                         <link linkend="char">char</link> *text,
                                                         <link linkend="int">int</link> length,
                                                         <link linkend="PangoAnalysis">PangoAnalysis</link> *analysis,
                                                         <link linkend="int">int</link> index_,
                                                         <link linkend="gboolean">gboolean</link> trailing,
                                                         <link linkend="int">int</link> *x_pos);
<link linkend="void">void</link>                <link linkend="pango-glyph-string-x-to-index">pango_glyph_string_x_to_index</link>       (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs,
                                                         <link linkend="char">char</link> *text,
                                                         <link linkend="int">int</link> length,
                                                         <link linkend="PangoAnalysis">PangoAnalysis</link> *analysis,
                                                         <link linkend="int">int</link> x_pos,
                                                         <link linkend="int">int</link> *index_,
                                                         <link linkend="int">int</link> *trailing);
<link linkend="void">void</link>                <link linkend="pango-glyph-string-get-logical-widths">pango_glyph_string_get_logical_widths</link>
                                                        (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs,
                                                         const <link linkend="char">char</link> *text,
                                                         <link linkend="int">int</link> length,
                                                         <link linkend="int">int</link> embedding_level,
                                                         <link linkend="int">int</link> *logical_widths);
<link linkend="PangoGlyphItem">PangoGlyphItem</link>*     <link linkend="pango-glyph-item-split">pango_glyph_item_split</link>              (<link linkend="PangoGlyphItem">PangoGlyphItem</link> *orig,
                                                         const <link linkend="char">char</link> *text,
                                                         <link linkend="int">int</link> split_index);
<link linkend="GSList">GSList</link>*             <link linkend="pango-glyph-item-apply-attrs">pango_glyph_item_apply_attrs</link>        (<link linkend="PangoGlyphItem">PangoGlyphItem</link> *glyph_item,
                                                         const <link linkend="char">char</link> *text,
                                                         <link linkend="PangoAttrList">PangoAttrList</link> *list);
<link linkend="void">void</link>                <link linkend="pango-glyph-item-letter-space">pango_glyph_item_letter_space</link>       (<link linkend="PangoGlyphItem">PangoGlyphItem</link> *glyph_item,
                                                         const <link linkend="char">char</link> *text,
                                                         <link linkend="PangoLogAttr">PangoLogAttr</link> *log_attrs,
                                                         <link linkend="int">int</link> letter_spacing);
<link linkend="void">void</link>                <link linkend="pango-glyph-item-free">pango_glyph_item_free</link>               (<link linkend="PangoGlyphItem">PangoGlyphItem</link> *glyph_item);

</synopsis>
</refsynopsisdiv>









<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="pango-shape"><function>pango_shape()</function></link> produces a string of glyphs which
can be measured or drawn to the screen. The following
structures are used to store information about
glyphs.
</para>
</refsect1>

<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="PANGO-SCALE:CAPS" role="macro"/>PANGO_SCALE</title>
<indexterm><primary>PANGO_SCALE</primary></indexterm><programlisting>#define PANGO_SCALE 1024
</programlisting>
<para>
The <link linkend="PANGO-SCALE:CAPS"><literal>PANGO_SCALE</literal></link> macro represents the scale between dimensions used
for Pango distances and device units. (The definition of device
units is dependent on the output device; it will typically be pixels
for a screen, and points for a printer.) <link linkend="PANGO-SCALE:CAPS"><literal>PANGO_SCALE</literal></link> is currently
1024, but this may be changed in the future.
</para>
<para>
When setting font sizes, device units are always considered to be
points (as in "12 point font"), rather than pixels. 
</para></refsect2>
<refsect2>
<title><anchor id="PANGO-PIXELS:CAPS" role="macro"/>PANGO_PIXELS()</title>
<indexterm><primary>PANGO_PIXELS</primary></indexterm><programlisting>#define PANGO_PIXELS(d) (((int)(d) + 512) &gt;&gt; 10)
</programlisting>
<para>
Converts a dimension to device units by rounding.
</para><variablelist role="params">
<varlistentry><term><parameter>d</parameter>&nbsp;:</term>
<listitem><simpara>a dimension in Pango units.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>rounded dimension in device units.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PANGO-PIXELS-FLOOR:CAPS" role="macro" condition="since:1.14"/>PANGO_PIXELS_FLOOR()</title>
<indexterm role="1.14"><primary>PANGO_PIXELS_FLOOR</primary></indexterm><programlisting>#define PANGO_PIXELS_FLOOR(d) (((int)(d)) &gt;&gt; 10)
</programlisting>
<para>
Converts a dimension to device units by flooring.
</para><variablelist role="params">
<varlistentry><term><parameter>d</parameter>&nbsp;:</term>
<listitem><simpara>a dimension in Pango units.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>floored dimension in device units.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.14


</para></refsect2>
<refsect2>
<title><anchor id="PANGO-PIXELS-CEIL:CAPS" role="macro" condition="since:1.14"/>PANGO_PIXELS_CEIL()</title>
<indexterm role="1.14"><primary>PANGO_PIXELS_CEIL</primary></indexterm><programlisting>#define PANGO_PIXELS_CEIL(d) (((int)(d) + 1023) &gt;&gt; 10)
</programlisting>
<para>
Converts a dimension to device units by ceiling.
</para><variablelist role="params">
<varlistentry><term><parameter>d</parameter>&nbsp;:</term>
<listitem><simpara>a dimension in Pango units.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>ceiled dimension in device units.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.14


</para></refsect2>
<refsect2>
<title><anchor id="PANGO-UNITS-ROUND:CAPS" role="macro" condition="since:1.18"/>PANGO_UNITS_ROUND()</title>
<indexterm role="1.18"><primary>PANGO_UNITS_ROUND</primary></indexterm><programlisting>#define             PANGO_UNITS_ROUND(d)</programlisting>
<para>
Rounds a dimension to whole device units, but does not
convert it to device units.
</para><variablelist role="params">
<varlistentry><term><parameter>d</parameter>&nbsp;:</term>
<listitem><simpara>a dimension in Pango units.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>rounded dimension in Pango units.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.18


</para></refsect2>
<refsect2>
<title><anchor id="pango-units-to-double" role="function" condition="since:1.16"/>pango_units_to_double ()</title>
<indexterm role="1.16"><primary>pango_units_to_double</primary></indexterm><programlisting><link linkend="double">double</link>              pango_units_to_double               (<link linkend="int">int</link> i);</programlisting>
<para>
Converts a number in Pango units to floating-point: divides
it by <link linkend="PANGO-SCALE:CAPS"><literal>PANGO_SCALE</literal></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>i</parameter>&nbsp;:</term>
<listitem><simpara> value in Pango units
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the double value.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.16
</para></refsect2>
<refsect2>
<title><anchor id="pango-units-from-double" role="function" condition="since:1.16"/>pango_units_from_double ()</title>
<indexterm role="1.16"><primary>pango_units_from_double</primary></indexterm><programlisting><link linkend="int">int</link>                 pango_units_from_double             (<link linkend="double">double</link> d);</programlisting>
<para>
Converts a floating-point number to Pango units: multiplies
it by <link linkend="PANGO-SCALE:CAPS"><literal>PANGO_SCALE</literal></link> and rounds to nearest integer.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>d</parameter>&nbsp;:</term>
<listitem><simpara> double floating-point value
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the value in Pango units.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.16
</para></refsect2>
<refsect2>
<title><anchor id="PangoRectangle" role="struct"/>PangoRectangle</title>
<indexterm><primary>PangoRectangle</primary></indexterm><programlisting>typedef struct {
  int x;
  int y;
  int width;
  int height;
} PangoRectangle;
</programlisting>
<para>
The <link linkend="PangoRectangle"><type>PangoRectangle</type></link> structure represents a rectangle. It is frequently
used to represent the logical or ink extents of a single glyph or section
of text. (See, for instance, <link linkend="pango-font-get-glyph-extents"><function>pango_font_get_glyph_extents()</function></link>)
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="int">int</link>&nbsp;<structfield>x</structfield>;</term>
<listitem><simpara>X coordinate of the left side of the rectangle.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="int">int</link>&nbsp;<structfield>y</structfield>;</term>
<listitem><simpara>Y coordinate of the the top side of the rectangle.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="int">int</link>&nbsp;<structfield>width</structfield>;</term>
<listitem><simpara>width of the rectangle.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="int">int</link>&nbsp;<structfield>height</structfield>;</term>
<listitem><simpara>height of the rectangle.

</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PANGO-ASCENT:CAPS" role="macro"/>PANGO_ASCENT()</title>
<indexterm><primary>PANGO_ASCENT</primary></indexterm><programlisting>#define PANGO_ASCENT(rect) (-(rect).y)
</programlisting>
<para>
Extracts the <firstterm>ascent</firstterm> from a <link linkend="PangoRectangle"><type>PangoRectangle</type></link>
representing glyph extents. The ascent is the distance from the
baseline to the highest point of the character. This is positive if the
glyph ascends above the baseline.
</para><variablelist role="params">
<varlistentry><term><parameter>rect</parameter>&nbsp;:</term>
<listitem><simpara>a <link linkend="PangoRectangle"><type>PangoRectangle</type></link>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PANGO-DESCENT:CAPS" role="macro"/>PANGO_DESCENT()</title>
<indexterm><primary>PANGO_DESCENT</primary></indexterm><programlisting>#define PANGO_DESCENT(rect) ((rect).y + (rect).height)
</programlisting>
<para>
Extracts the <firstterm>descent</firstterm> from a <link linkend="PangoRectangle"><type>PangoRectangle</type></link>
representing glyph extents. The descent is the distance from the
baseline to the lowest point of the character. This is positive if the
glyph descends below the baseline.
</para><variablelist role="params">
<varlistentry><term><parameter>rect</parameter>&nbsp;:</term>
<listitem><simpara>a <link linkend="PangoRectangle"><type>PangoRectangle</type></link>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PANGO-LBEARING:CAPS" role="macro"/>PANGO_LBEARING()</title>
<indexterm><primary>PANGO_LBEARING</primary></indexterm><programlisting>#define PANGO_LBEARING(rect) ((rect).x)
</programlisting>
<para>
Extracts the <firstterm>left bearing</firstterm> from a <link linkend="PangoRectangle"><type>PangoRectangle</type></link>
representing glyph extents. The left bearing is the distance from the
horizontal origin to the farthest left point of the character.
This is positive for characters drawn completely to the right of the
glyph origin.
</para><variablelist role="params">
<varlistentry><term><parameter>rect</parameter>&nbsp;:</term>
<listitem><simpara>a <link linkend="PangoRectangle"><type>PangoRectangle</type></link>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PANGO-RBEARING:CAPS" role="macro"/>PANGO_RBEARING()</title>
<indexterm><primary>PANGO_RBEARING</primary></indexterm><programlisting>#define PANGO_RBEARING(rect) ((rect).x + (rect).width)
</programlisting>
<para>
Extracts the <firstterm>right bearing</firstterm> from a <link linkend="PangoRectangle"><type>PangoRectangle</type></link>
representing glyph extents. The right bearing is the distance from the
horizontal origin to the farthest right point of the character.
This is positive except for characters drawn completely to the left of the
horizontal origin.
</para><variablelist role="params">
<varlistentry><term><parameter>rect</parameter>&nbsp;:</term>
<listitem><simpara>a <link linkend="PangoRectangle"><type>PangoRectangle</type></link>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-extents-to-pixels" role="function" condition="since:1.16"/>pango_extents_to_pixels ()</title>
<indexterm role="1.16"><primary>pango_extents_to_pixels</primary></indexterm><programlisting><link linkend="void">void</link>                pango_extents_to_pixels             (<link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);</programlisting>
<para>
Converts extents from Pango units to device units, dividing by the
<link linkend="PANGO-SCALE:CAPS"><literal>PANGO_SCALE</literal></link> factor and performing rounding.
</para>
<para>
The ink rectangle is converted by flooring the x/y coordinates and extending
width/height, such that the final rectangle completely includes the original
rectangle.
</para>
<para>
The logical rectangle is converted by rounding the coordinates
of the rectangle to the nearest device unit.
</para>
<para>
Note that in certain situations you may want pass a logical extents
rectangle to this function as <parameter>ink_rect</parameter>.  The rule is: if you want the
resulting device-space rectangle to completely contain the original
rectangle, pass it in as <parameter>ink_rect</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>ink_rect</parameter>&nbsp;:</term>
<listitem><simpara> ink rectangle to convert, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>logical_rect</parameter>&nbsp;:</term>
<listitem><simpara> logical rectangle to convert, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.16
</para></refsect2>
<refsect2>
<title><anchor id="PangoMatrix" role="struct" condition="since:1.6"/>PangoMatrix</title>
<indexterm role="1.6"><primary>PangoMatrix</primary></indexterm><programlisting>typedef struct {
  double xx;
  double xy;
  double yx;
  double yy;
  double x0;
  double y0;
} PangoMatrix;
</programlisting>
<para>
A structure specifying a transformation between user-space
coordinates and device coordinates. The transformation
is given by
</para>
<para>
<programlisting>
x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0;
y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0;
</programlisting></para>
<para>

</para><variablelist role="struct">
<varlistentry>
<term><link linkend="double">double</link>&nbsp;<structfield>xx</structfield>;</term>
<listitem><simpara> 1st component of the transformation matrix
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="double">double</link>&nbsp;<structfield>xy</structfield>;</term>
<listitem><simpara> 2nd component of the transformation matrix
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="double">double</link>&nbsp;<structfield>yx</structfield>;</term>
<listitem><simpara> 3rd component of the transformation matrix
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="double">double</link>&nbsp;<structfield>yy</structfield>;</term>
<listitem><simpara> 4th component of the transformation matrix
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="double">double</link>&nbsp;<structfield>x0</structfield>;</term>
<listitem><simpara> x translation
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="double">double</link>&nbsp;<structfield>y0</structfield>;</term>
<listitem><simpara> y translation
</simpara></listitem>
</varlistentry>
</variablelist><para role="since">Since  1.6
</para></refsect2>
<refsect2>
<title><anchor id="PANGO-TYPE-MATRIX:CAPS" role="macro"/>PANGO_TYPE_MATRIX</title>
<indexterm><primary>PANGO_TYPE_MATRIX</primary></indexterm><programlisting>#define PANGO_TYPE_MATRIX (pango_matrix_get_type ())
</programlisting>
<para>
The GObject type for <link linkend="PangoMatrix"><type>PangoMatrix</type></link></para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="PANGO-MATRIX-INIT:CAPS" role="macro" condition="since:1.6"/>PANGO_MATRIX_INIT</title>
<indexterm role="1.6"><primary>PANGO_MATRIX_INIT</primary></indexterm><programlisting>#define PANGO_MATRIX_INIT { 1., 0., 0., 1., 0., 0. }
</programlisting>
<para>
Constant that can be used to initialize a PangoMatrix to
the identity transform.
</para>
<para>
<informalexample><programlisting>
PangoMatrix matrix = PANGO_MATRIX_INIT;
pango_matrix_rotate (&amp;matrix, 45.);
</programlisting></informalexample></para>
<para>

</para><para role="since">Since  1.6
</para></refsect2>
<refsect2>
<title><anchor id="pango-matrix-copy" role="function" condition="since:1.6"/>pango_matrix_copy ()</title>
<indexterm role="1.6"><primary>pango_matrix_copy</primary></indexterm><programlisting><link linkend="PangoMatrix">PangoMatrix</link>*        pango_matrix_copy                   (const <link linkend="PangoMatrix">PangoMatrix</link> *matrix);</programlisting>
<para>
Copies a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>matrix</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>, can be <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly allocated <link linkend="PangoMatrix"><type>PangoMatrix</type></link>, which should
              be freed with <link linkend="pango-matrix-free"><function>pango_matrix_free()</function></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if
              <parameter>matrix</parameter> was <link linkend="NULL:CAPS"><literal>NULL</literal></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.6
</para></refsect2>
<refsect2>
<title><anchor id="pango-matrix-free" role="function" condition="since:1.6"/>pango_matrix_free ()</title>
<indexterm role="1.6"><primary>pango_matrix_free</primary></indexterm><programlisting><link linkend="void">void</link>                pango_matrix_free                   (<link linkend="PangoMatrix">PangoMatrix</link> *matrix);</programlisting>
<para>
Free a <link linkend="PangoMatrix"><type>PangoMatrix</type></link> created with <link linkend="pango-matrix-copy"><function>pango_matrix_copy()</function></link>.
Does nothing if <parameter>matrix</parameter> is <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>matrix</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.6
</para></refsect2>
<refsect2>
<title><anchor id="pango-matrix-translate" role="function" condition="since:1.6"/>pango_matrix_translate ()</title>
<indexterm role="1.6"><primary>pango_matrix_translate</primary></indexterm><programlisting><link linkend="void">void</link>                pango_matrix_translate              (<link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         <link linkend="double">double</link> tx,
                                                         <link linkend="double">double</link> ty);</programlisting>
<para>
Changes the transformation represented by <parameter>matrix</parameter> to be the
transformation given by first translating by (<parameter>tx</parameter>, <parameter>ty</parameter>)
then applying the original transformation.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>matrix</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tx</parameter>&nbsp;:</term>
<listitem><simpara> amount to translate in the X direction
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ty</parameter>&nbsp;:</term>
<listitem><simpara> amount to translate in the Y direction
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.6
</para></refsect2>
<refsect2>
<title><anchor id="pango-matrix-scale" role="function" condition="since:1.6"/>pango_matrix_scale ()</title>
<indexterm role="1.6"><primary>pango_matrix_scale</primary></indexterm><programlisting><link linkend="void">void</link>                pango_matrix_scale                  (<link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         <link linkend="double">double</link> scale_x,
                                                         <link linkend="double">double</link> scale_y);</programlisting>
<para>
Changes the transformation represented by <parameter>matrix</parameter> to be the
transformation given by first scaling by <parameter>sx</parameter> in the X direction
and <parameter>sy</parameter> in the Y direction then applying the original
transformation.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>matrix</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>scale_x</parameter>&nbsp;:</term>
<listitem><simpara> amount to scale by in X direction
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>scale_y</parameter>&nbsp;:</term>
<listitem><simpara> amount to scale by in Y direction
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.6
</para></refsect2>
<refsect2>
<title><anchor id="pango-matrix-rotate" role="function" condition="since:1.6"/>pango_matrix_rotate ()</title>
<indexterm role="1.6"><primary>pango_matrix_rotate</primary></indexterm><programlisting><link linkend="void">void</link>                pango_matrix_rotate                 (<link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         <link linkend="double">double</link> degrees);</programlisting>
<para>
Changes the transformation represented by <parameter>matrix</parameter> to be the
transformation given by first rotating by <parameter>degrees</parameter> degrees
counter-clockwise then applying the original transformation.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>matrix</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>degrees</parameter>&nbsp;:</term>
<listitem><simpara> degrees to rotate counter-clockwise
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.6
</para></refsect2>
<refsect2>
<title><anchor id="pango-matrix-concat" role="function" condition="since:1.6"/>pango_matrix_concat ()</title>
<indexterm role="1.6"><primary>pango_matrix_concat</primary></indexterm><programlisting><link linkend="void">void</link>                pango_matrix_concat                 (<link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         const <link linkend="PangoMatrix">PangoMatrix</link> *new_matrix);</programlisting>
<para>
Changes the transformation represented by <parameter>matrix</parameter> to be the
transformation given by first applying transformation
given by <parameter>new_matrix</parameter> then applying the original transformation.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>matrix</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>new_matrix</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.6
</para></refsect2>
<refsect2>
<title><anchor id="pango-matrix-transform-point" role="function" condition="since:1.16"/>pango_matrix_transform_point ()</title>
<indexterm role="1.16"><primary>pango_matrix_transform_point</primary></indexterm><programlisting><link linkend="void">void</link>                pango_matrix_transform_point        (const <link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         <link linkend="double">double</link> *x,
                                                         <link linkend="double">double</link> *y);</programlisting>
<para>
Transforms the point (<parameter>x</parameter>, <parameter>y</parameter>) by <parameter>matrix</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>matrix</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara> in/out X position
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara> in/out Y position
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.16
</para></refsect2>
<refsect2>
<title><anchor id="pango-matrix-transform-distance" role="function" condition="since:1.16"/>pango_matrix_transform_distance ()</title>
<indexterm role="1.16"><primary>pango_matrix_transform_distance</primary></indexterm><programlisting><link linkend="void">void</link>                pango_matrix_transform_distance     (const <link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         <link linkend="double">double</link> *dx,
                                                         <link linkend="double">double</link> *dy);</programlisting>
<para>
Transforms the distance vector (<parameter>dx</parameter>,<parameter>dy</parameter>) by <parameter>matrix</parameter>. This is
similar to <link linkend="pango-matrix-transform-point"><function>pango_matrix_transform_point()</function></link> except that the translation
components of the transformation are ignored. The calculation of
the returned vector is as follows:
</para>
<para>
<programlisting>
dx2 = dx1 * xx + dy1 * xy;
dy2 = dx1 * yx + dy1 * yy;
</programlisting>
</para>
<para>
Affine transformations are position invariant, so the same vector
always transforms to the same vector. If (<parameter>x1</parameter>,<parameter>y1</parameter>) transforms
to (<parameter>x2</parameter>,<parameter>y2</parameter>) then (<parameter>x1</parameter>+<parameter>dx1</parameter>,<parameter>y1</parameter>+<parameter>dy1</parameter>) will transform to
(<parameter>x1</parameter>+<parameter>dx2</parameter>,<parameter>y1</parameter>+<parameter>dy2</parameter>) for all values of <parameter>x1</parameter> and <parameter>x2</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>matrix</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dx</parameter>&nbsp;:</term>
<listitem><simpara> in/out X component of a distance vector
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dy</parameter>&nbsp;:</term>
<listitem><simpara> yn/out Y component of a distance vector
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.16
</para></refsect2>
<refsect2>
<title><anchor id="pango-matrix-transform-rectangle" role="function" condition="since:1.16"/>pango_matrix_transform_rectangle ()</title>
<indexterm role="1.16"><primary>pango_matrix_transform_rectangle</primary></indexterm><programlisting><link linkend="void">void</link>                pango_matrix_transform_rectangle    (const <link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *rect);</programlisting>
<para>
First transforms <parameter>rect</parameter> using <parameter>matrix</parameter>, then calculates the bounding box
of the transformed rectangle.  The rectangle should be in Pango units.
</para>
<para>
This function is useful for example when you want to draw a rotated
<parameter>PangoLayout</parameter> to an image buffer, and want to know how large the image
should be and how much you should shift the layout when rendering.
</para>
<para>
If you have a rectangle in device units (pixels), use
<link linkend="pango-matrix-transform-pixel-rectangle"><function>pango_matrix_transform_pixel_rectangle()</function></link>.
</para>
<para>
If you have the rectangle in Pango units and want to convert to
transformed pixel bounding box, it is more accurate to transform it first
(using this function) and pass the result to <link linkend="pango-extents-to-pixels"><function>pango_extents_to_pixels()</function></link>,
as <parameter>ink_rect</parameter>.  However, there is a reason that you may want to convert
to pixels first and then transform, and that is when the transformed
coordinates may overflow in Pango units (large matrix translation for
example).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>matrix</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rect</parameter>&nbsp;:</term>
<listitem><simpara> in/out bounding box in Pango units, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.16
</para></refsect2>
<refsect2>
<title><anchor id="pango-matrix-transform-pixel-rectangle" role="function" condition="since:1.16"/>pango_matrix_transform_pixel_rectangle ()</title>
<indexterm role="1.16"><primary>pango_matrix_transform_pixel_rectangle</primary></indexterm><programlisting><link linkend="void">void</link>                pango_matrix_transform_pixel_rectangle
                                                        (const <link linkend="PangoMatrix">PangoMatrix</link> *matrix,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *rect);</programlisting>
<para>
First transforms the <parameter>rect</parameter> using <parameter>matrix</parameter>, then calculates the bounding box
of the transformed rectangle.  The rectangle should be in device units
(pixels).
</para>
<para>
This function is useful for example when you want to draw a rotated
<parameter>PangoLayout</parameter> to an image buffer, and want to know how large the image
should be and how much you should shift the layout when rendering.
</para>
<para>
For better accuracy, you should use <link linkend="pango-matrix-transform-rectangle"><function>pango_matrix_transform_rectangle()</function></link> on
original rectangle in Pango units and convert to pixels afterward
using <link linkend="pango-extents-to-pixels"><function>pango_extents_to_pixels()</function></link> as <parameter>ink_rect</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>matrix</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rect</parameter>&nbsp;:</term>
<listitem><simpara> in/out bounding box in device units, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.16
</para></refsect2>
<refsect2>
<title><anchor id="pango-matrix-get-font-scale-factor" role="function" condition="since:1.12"/>pango_matrix_get_font_scale_factor ()</title>
<indexterm role="1.12"><primary>pango_matrix_get_font_scale_factor</primary></indexterm><programlisting><link linkend="double">double</link>              pango_matrix_get_font_scale_factor  (const <link linkend="PangoMatrix">PangoMatrix</link> *matrix);</programlisting>
<para>
Returns the scale factor of a matrix on the height of the font.
That is, the scale factor in the direction perpendicular to the
vector that the X coordinate is mapped to.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>matrix</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoMatrix"><type>PangoMatrix</type></link>, may be <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the scale factor of <parameter>matrix</parameter> on the height of the font,
or 1.0 if <parameter>matrix</parameter> is <link linkend="NULL:CAPS"><literal>NULL</literal></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.12
</para></refsect2>
<refsect2>
<title><anchor id="PangoGlyph" role="typedef"/>PangoGlyph</title>
<indexterm><primary>PangoGlyph</primary></indexterm><programlisting>typedef guint32 PangoGlyph;
</programlisting>
<para>
A <link linkend="PangoGlyph"><type>PangoGlyph</type></link> represents a single glyph in the output form of a string.
</para></refsect2>
<refsect2>
<title><anchor id="PANGO-GLYPH-EMPTY:CAPS" role="macro"/>PANGO_GLYPH_EMPTY</title>
<indexterm><primary>PANGO_GLYPH_EMPTY</primary></indexterm><programlisting>#define PANGO_GLYPH_EMPTY           ((PangoGlyph)0x0FFFFFFF)
</programlisting>
<para>
The <link linkend="PANGO-GLYPH-EMPTY:CAPS"><literal>PANGO_GLYPH_EMPTY</literal></link> macro represents a <link linkend="PangoGlyph"><type>PangoGlyph</type></link> value that has a
special meaning, which is a zero-width empty glyph.  This is useful for
example in shaper modules, to use as the glyph for various zero-width
Unicode characters (those passing <link linkend="pango-is-zero-width"><function>pango_is_zero_width()</function></link>).
</para></refsect2>
<refsect2>
<title><anchor id="PANGO-GLYPH-UNKNOWN-FLAG:CAPS" role="macro"/>PANGO_GLYPH_UNKNOWN_FLAG</title>
<indexterm><primary>PANGO_GLYPH_UNKNOWN_FLAG</primary></indexterm><programlisting>#define PANGO_GLYPH_UNKNOWN_FLAG    ((PangoGlyph)0x10000000)
</programlisting>
<para>
The <link linkend="PANGO-GLYPH-UNKNOWN-FLAG:CAPS"><literal>PANGO_GLYPH_UNKNOWN_FLAG</literal></link> macro is a flag value that can be added to
a <link linkend="gunichar"><type>gunichar</type></link> value of a valid Unicode character, to produce a <link linkend="PangoGlyph"><type>PangoGlyph</type></link>
value, representing an unknown-character glyph for the respective <link linkend="gunichar"><type>gunichar</type></link>.
</para></refsect2>
<refsect2>
<title><anchor id="PANGO-GET-UNKNOWN-GLYPH:CAPS" role="macro"/>PANGO_GET_UNKNOWN_GLYPH()</title>
<indexterm><primary>PANGO_GET_UNKNOWN_GLYPH</primary></indexterm><programlisting>#define PANGO_GET_UNKNOWN_GLYPH(wc) ((PangoGlyph)(wc)|PANGO_GLYPH_UNKNOWN_FLAG)
</programlisting>
<para>
Returns a <link linkend="PangoGlyph"><type>PangoGlyph</type></link> value that means no glyph was found for <parameter>wc</parameter>.
The way this unknown glyphs are rendered is backend specific.  For example,
a box with the hexadecimal Unicode code-point of the character written in it
is what is done in the most common backends.
</para><variablelist role="params">
<varlistentry><term><parameter>wc</parameter>&nbsp;:</term>
<listitem><simpara>a Unicode character


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PangoGlyphInfo" role="struct"/>PangoGlyphInfo</title>
<indexterm><primary>PangoGlyphInfo</primary></indexterm><programlisting>typedef struct {
  PangoGlyph    glyph;
  PangoGlyphGeometry geometry;
  PangoGlyphVisAttr  attr;
} PangoGlyphInfo;
</programlisting>
<para>
The <link linkend="PangoGlyphInfo"><type>PangoGlyphInfo</type></link> structure represents a single glyph together with
positioning information and visual attributes.
It contains the following fields.
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="PangoGlyph">PangoGlyph</link>&nbsp;<structfield>glyph</structfield>;</term>
<listitem><simpara>the glyph itself.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="PangoGlyphGeometry">PangoGlyphGeometry</link>&nbsp;<structfield>geometry</structfield>;</term>
<listitem><simpara>the positional information about the glyph.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="PangoGlyphVisAttr">PangoGlyphVisAttr</link>&nbsp;<structfield>attr</structfield>;</term>
<listitem><simpara>the visual attributes of the glyph.

</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PangoGlyphGeometry" role="struct"/>PangoGlyphGeometry</title>
<indexterm><primary>PangoGlyphGeometry</primary></indexterm><programlisting>typedef struct {
  PangoGlyphUnit width;
  PangoGlyphUnit x_offset;
  PangoGlyphUnit y_offset;
} PangoGlyphGeometry;
</programlisting>
<para>
The <link linkend="PangoGlyphGeometry"><type>PangoGlyphGeometry</type></link> structure contains width and positioning
information for a single glyph. 
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="PangoGlyphUnit">PangoGlyphUnit</link>&nbsp;<structfield>width</structfield>;</term>
<listitem><simpara>the logical width to use for the the character.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="PangoGlyphUnit">PangoGlyphUnit</link>&nbsp;<structfield>x_offset</structfield>;</term>
<listitem><simpara>horizontal offset from nominal character position.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="PangoGlyphUnit">PangoGlyphUnit</link>&nbsp;<structfield>y_offset</structfield>;</term>
<listitem><simpara>vertical offset from nominal character position.

</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PangoGlyphUnit" role="typedef"/>PangoGlyphUnit</title>
<indexterm><primary>PangoGlyphUnit</primary></indexterm><programlisting>typedef gint32 PangoGlyphUnit;
</programlisting>
<para>
The <link linkend="PangoGlyphUnit"><type>PangoGlyphUnit</type></link> type is used to store dimensions within
Pango. Dimensions are stored in 1/<link linkend="PANGO-SCALE:CAPS"><literal>PANGO_SCALE</literal></link> of a device unit.
(A device unit might be a pixel for screen display, or
a point on a printer.) <link linkend="PANGO-SCALE:CAPS"><literal>PANGO_SCALE</literal></link> is currently 1024, and
may change in the future (unlikely though), but you should not
depend on its exact value. The <link linkend="PANGO-PIXELS:CAPS"><function>PANGO_PIXELS()</function></link> macro can be used
to convert from glyph units into device units with correct rounding.
</para></refsect2>
<refsect2>
<title><anchor id="PangoGlyphVisAttr" role="struct"/>PangoGlyphVisAttr</title>
<indexterm><primary>PangoGlyphVisAttr</primary></indexterm><programlisting>typedef struct {
  guint is_cluster_start : 1;
} PangoGlyphVisAttr;
</programlisting>
<para>
The PangoGlyphVisAttr is used to communicate information between
the shaping phase and the rendering phase.  More attributes may be
added in the future.
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="guint">guint</link>&nbsp;<structfield>is_cluster_start</structfield>&nbsp;:&nbsp;1;</term>
<listitem><simpara>set for the first logical glyph in each cluster. (Clusters
		   are stored in visual order, within the cluster, glyphs
		   are always ordered in logical order, since visual
		   order is meaningless; that is, in Arabic text, accent glyphs
		   follow the glyphs for the base character.)

</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PangoGlyphString" role="struct"/>PangoGlyphString</title>
<indexterm><primary>PangoGlyphString</primary></indexterm><programlisting>typedef struct {
  gint num_glyphs;

  PangoGlyphInfo *glyphs;

  /* This is a memory inefficient way of representing the information
   * here - each value gives the byte index within the text
   * corresponding to the glyph string of the start of the cluster to
   * which the glyph belongs.
   */
  gint *log_clusters;
} PangoGlyphString;
</programlisting>
<para>
The <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link> structure is used to store strings
of glyphs with geometry and visual attribute information.
The storage for the glyph information is owned
by the structure which simplifies memory management.
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="gint">gint</link>&nbsp;<structfield>num_glyphs</structfield>;</term>
<listitem><simpara>the number of glyphs in the string.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="PangoGlyphInfo">PangoGlyphInfo</link>&nbsp;*<structfield>glyphs</structfield>;</term>
<listitem><simpara>an array of <link linkend="PangoGlyphInfo"><type>PangoGlyphInfo</type></link> structures of length <structfield>num_glyphs</structfield>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gint">gint</link>&nbsp;*<structfield>log_clusters</structfield>;</term>
<listitem><simpara>for each glyph, byte index of the starting character for the
cluster. The indices are relative to the start of the text
corresponding to the PangoGlyphString.

</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PangoGlyphItem" role="struct"/>PangoGlyphItem</title>
<indexterm><primary>PangoGlyphItem</primary></indexterm><programlisting>typedef struct {
  PangoItem        *item;
  PangoGlyphString *glyphs;
} PangoGlyphItem;
</programlisting>
<para>
A <link linkend="PangoGlyphItem"><type>PangoGlyphItem</type></link> is a pair of a <link linkend="PangoItem"><type>PangoItem</type></link> and the glyphs
resulting from shaping the text corresponding to an item.
As an example of the usage of <link linkend="PangoGlyphItem"><type>PangoGlyphItem</type></link>, the results
of shaping text with <link linkend="PangoLayout"><type>PangoLayout</type></link> is a list of <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link>,
each of which contains a list of <link linkend="PangoGlyphItem"><type>PangoGlyphItem</type></link>.
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="PangoItem">PangoItem</link>&nbsp;*<structfield>item</structfield>;</term>
<listitem><simpara>a <link linkend="PangoItem"><type>PangoItem</type></link> structure that provides information
       about a segment of text.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="PangoGlyphString">PangoGlyphString</link>&nbsp;*<structfield>glyphs</structfield>;</term>
<listitem><simpara>the glyphs obtained by shaping the text
         corresponding to <parameter>item</parameter>.

</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PANGO-TYPE-GLYPH-STRING:CAPS" role="macro"/>PANGO_TYPE_GLYPH_STRING</title>
<indexterm><primary>PANGO_TYPE_GLYPH_STRING</primary></indexterm><programlisting>#define PANGO_TYPE_GLYPH_STRING (pango_glyph_string_get_type ())
</programlisting>
<para>
The <link linkend="GObject"><type>GObject</type></link> type for <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>.
</para></refsect2>
<refsect2>
<title><anchor id="pango-glyph-string-new" role="function"/>pango_glyph_string_new ()</title>
<indexterm><primary>pango_glyph_string_new</primary></indexterm><programlisting><link linkend="PangoGlyphString">PangoGlyphString</link>*   pango_glyph_string_new              (void);</programlisting>
<para>
Create a new <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly allocated <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>, which
              should be freed with <link linkend="pango-glyph-string-free"><function>pango_glyph_string_free()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-glyph-string-copy" role="function"/>pango_glyph_string_copy ()</title>
<indexterm><primary>pango_glyph_string_copy</primary></indexterm><programlisting><link linkend="PangoGlyphString">PangoGlyphString</link>*   pango_glyph_string_copy             (<link linkend="PangoGlyphString">PangoGlyphString</link> *string);</programlisting>
<para>
Copy a glyph string and associated storage.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>string</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly allocated <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>, which
              should be freed with <link linkend="pango-glyph-string-free"><function>pango_glyph_string_free()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-glyph-string-set-size" role="function"/>pango_glyph_string_set_size ()</title>
<indexterm><primary>pango_glyph_string_set_size</primary></indexterm><programlisting><link linkend="void">void</link>                pango_glyph_string_set_size         (<link linkend="PangoGlyphString">PangoGlyphString</link> *string,
                                                         <link linkend="gint">gint</link> new_len);</programlisting>
<para>
Resize a glyph string to the given length.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>string</parameter>&nbsp;:</term>
<listitem><simpara>    a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>new_len</parameter>&nbsp;:</term>
<listitem><simpara>   the new length of the string.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-glyph-string-free" role="function"/>pango_glyph_string_free ()</title>
<indexterm><primary>pango_glyph_string_free</primary></indexterm><programlisting><link linkend="void">void</link>                pango_glyph_string_free             (<link linkend="PangoGlyphString">PangoGlyphString</link> *string);</programlisting>
<para>
Free a glyph string and associated storage.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>string</parameter>&nbsp;:</term>
<listitem><simpara>    a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-glyph-string-extents" role="function"/>pango_glyph_string_extents ()</title>
<indexterm><primary>pango_glyph_string_extents</primary></indexterm><programlisting><link linkend="void">void</link>                pango_glyph_string_extents          (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs,
                                                         <link linkend="PangoFont">PangoFont</link> *font,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);</programlisting>
<para>
Compute the logical and ink extents of a glyph string. See the documentation
for <link linkend="pango-font-get-glyph-extents"><function>pango_font_get_glyph_extents()</function></link> for details about the interpretation
of the rectangles.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>glyphs</parameter>&nbsp;:</term>
<listitem><simpara>   a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
<listitem><simpara>     a <link linkend="PangoFont"><type>PangoFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ink_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle used to store the extents of the glyph string as drawn
           or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to indicate that the result is not needed.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>logical_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle used to store the logical extents of the glyph string
           or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to indicate that the result is not needed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-glyph-string-extents-range" role="function"/>pango_glyph_string_extents_range ()</title>
<indexterm><primary>pango_glyph_string_extents_range</primary></indexterm><programlisting><link linkend="void">void</link>                pango_glyph_string_extents_range    (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs,
                                                         <link linkend="int">int</link> start,
                                                         <link linkend="int">int</link> end,
                                                         <link linkend="PangoFont">PangoFont</link> *font,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);</programlisting>
<para>
Computes the extents of a sub-portion of a glyph string. 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>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>glyphs</parameter>&nbsp;:</term>
<listitem><simpara>   a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&nbsp;:</term>
<listitem><simpara>    start index
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&nbsp;:</term>
<listitem><simpara>      end index (the range is the set of bytes with
	      indices such that start &lt;= index &lt; end)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
<listitem><simpara>     a <link linkend="PangoFont"><type>PangoFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ink_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle used to store the extents of the glyph string range as drawn
           or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to indicate that the result is not needed.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>logical_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle used to store the logical extents of the glyph string range
           or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to indicate that the result is not needed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-glyph-string-get-width" role="function" condition="since:1.14"/>pango_glyph_string_get_width ()</title>
<indexterm role="1.14"><primary>pango_glyph_string_get_width</primary></indexterm><programlisting><link linkend="int">int</link>                 pango_glyph_string_get_width        (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs);</programlisting>
<para>
Computes the logical width of the glyph string as can also be computed
using <link linkend="pango-glyph-string-extents"><function>pango_glyph_string_extents()</function></link>.  However, since this only computes the
width, it's much faster.  This is in fact only a convenience function that
computes the sum of geometry.width for each glyph in the <parameter>glyphs</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>glyphs</parameter>&nbsp;:</term>
<listitem><simpara>   a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the logical width of the glyph string.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.14
</para></refsect2>
<refsect2>
<title><anchor id="pango-glyph-string-index-to-x" role="function"/>pango_glyph_string_index_to_x ()</title>
<indexterm><primary>pango_glyph_string_index_to_x</primary></indexterm><programlisting><link linkend="void">void</link>                pango_glyph_string_index_to_x       (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs,
                                                         <link linkend="char">char</link> *text,
                                                         <link linkend="int">int</link> length,
                                                         <link linkend="PangoAnalysis">PangoAnalysis</link> *analysis,
                                                         <link linkend="int">int</link> index_,
                                                         <link linkend="gboolean">gboolean</link> trailing,
                                                         <link linkend="int">int</link> *x_pos);</programlisting>
<para>
Converts from character position to x position. (X position
is measured from the left edge of the run). Character positions
are computed by dividing up each cluster into equal portions.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>glyphs</parameter>&nbsp;:</term>
<listitem><simpara>    the glyphs return from <link linkend="pango-shape"><function>pango_shape()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
<listitem><simpara>      the text for the run
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&nbsp;:</term>
<listitem><simpara>    the number of bytes (not characters) in <parameter>text</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>analysis</parameter>&nbsp;:</term>
<listitem><simpara>  the analysis information return from <link linkend="pango-itemize"><function>pango_itemize()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index_</parameter>&nbsp;:</term>
<listitem><simpara>    the byte index within <parameter>text</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>trailing</parameter>&nbsp;:</term>
<listitem><simpara>  whether we should compute the result for the beginning (<link linkend="FALSE:CAPS"><literal>FALSE</literal></link>)
            or end (<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>) of the character.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x_pos</parameter>&nbsp;:</term>
<listitem><simpara>     location to store result
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-glyph-string-x-to-index" role="function"/>pango_glyph_string_x_to_index ()</title>
<indexterm><primary>pango_glyph_string_x_to_index</primary></indexterm><programlisting><link linkend="void">void</link>                pango_glyph_string_x_to_index       (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs,
                                                         <link linkend="char">char</link> *text,
                                                         <link linkend="int">int</link> length,
                                                         <link linkend="PangoAnalysis">PangoAnalysis</link> *analysis,
                                                         <link linkend="int">int</link> x_pos,
                                                         <link linkend="int">int</link> *index_,
                                                         <link linkend="int">int</link> *trailing);</programlisting>
<para>
Convert from x offset to character position. Character positions
are computed by dividing up each cluster into equal portions.
In scripts where positioning within a cluster is not allowed
(such as Thai), the returned value may not be a valid cursor
position; the caller must combine the result with the logical
attributes for the text to compute the valid cursor position.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>glyphs</parameter>&nbsp;:</term>
<listitem><simpara>    the glyphs returned from <link linkend="pango-shape"><function>pango_shape()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
<listitem><simpara>      the text for the run
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&nbsp;:</term>
<listitem><simpara>    the number of bytes (not characters) in text.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>analysis</parameter>&nbsp;:</term>
<listitem><simpara>  the analysis information return from <link linkend="pango-itemize"><function>pango_itemize()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x_pos</parameter>&nbsp;:</term>
<listitem><simpara>     the x offset (in <link linkend="PangoGlyphUnit"><type>PangoGlyphUnit</type></link>)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index_</parameter>&nbsp;:</term>
<listitem><simpara>    location to store calculated byte index within <parameter>text</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>trailing</parameter>&nbsp;:</term>
<listitem><simpara>  location to store a boolean indicating
            whether the user clicked on the leading or trailing
            edge of the character.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-glyph-string-get-logical-widths" role="function"/>pango_glyph_string_get_logical_widths ()</title>
<indexterm><primary>pango_glyph_string_get_logical_widths</primary></indexterm><programlisting><link linkend="void">void</link>                pango_glyph_string_get_logical_widths
                                                        (<link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs,
                                                         const <link linkend="char">char</link> *text,
                                                         <link linkend="int">int</link> length,
                                                         <link linkend="int">int</link> embedding_level,
                                                         <link linkend="int">int</link> *logical_widths);</programlisting>
<para>
Given a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link> resulting from <link linkend="pango-shape"><function>pango_shape()</function></link> and the corresponding
text, determine the screen width corresponding to each character. When
multiple characters compose a single cluster, the width of the entire
cluster is divided equally among the characters.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>glyphs</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
<listitem><simpara> the text corresponding to the glyphs
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&nbsp;:</term>
<listitem><simpara> the length of <parameter>text</parameter>, in bytes
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>embedding_level</parameter>&nbsp;:</term>
<listitem><simpara> the embedding level of the string
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>logical_widths</parameter>&nbsp;:</term>
<listitem><simpara> an array whose length is g_utf8_strlen (text, length)
                 to be filled in with the resulting character widths.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-glyph-item-split" role="function" condition="since:1.2"/>pango_glyph_item_split ()</title>
<indexterm role="1.2"><primary>pango_glyph_item_split</primary></indexterm><programlisting><link linkend="PangoGlyphItem">PangoGlyphItem</link>*     pango_glyph_item_split              (<link linkend="PangoGlyphItem">PangoGlyphItem</link> *orig,
                                                         const <link linkend="char">char</link> *text,
                                                         <link linkend="int">int</link> split_index);</programlisting>
<para>
Modifies <parameter>orig</parameter> to cover only the text after <parameter>split_index</parameter>, and
returns a new item that covers the text before <parameter>split_index</parameter> that
used to be in <parameter>orig</parameter>. You can think of <parameter>split_index</parameter> as the length of
the returned item. <parameter>split_index</parameter> may not be 0, and it may not be
greater than or equal to the length of <parameter>orig</parameter> (that is, there must
be at least one byte assigned to each item, you can't create a
zero-length item).
</para>
<para>
This function is similar in function to <link linkend="pango-item-split"><function>pango_item_split()</function></link> (and uses
it internally.)</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>orig</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoItem"><type>PangoItem</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
<listitem><simpara> text to which positions in <parameter>orig</parameter> apply
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>split_index</parameter>&nbsp;:</term>
<listitem><simpara> byte index of position to split item, relative to the start of the item
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly allocated item representing text before
              <parameter>split_index</parameter>, which should be freed
              with <link linkend="pango-glyph-item-free"><function>pango_glyph_item_free()</function></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.2
</para></refsect2>
<refsect2>
<title><anchor id="pango-glyph-item-apply-attrs" role="function" condition="since:1.2"/>pango_glyph_item_apply_attrs ()</title>
<indexterm role="1.2"><primary>pango_glyph_item_apply_attrs</primary></indexterm><programlisting><link linkend="GSList">GSList</link>*             pango_glyph_item_apply_attrs        (<link linkend="PangoGlyphItem">PangoGlyphItem</link> *glyph_item,
                                                         const <link linkend="char">char</link> *text,
                                                         <link linkend="PangoAttrList">PangoAttrList</link> *list);</programlisting>
<para>
Splits a shaped item (PangoGlyphItem) into multiple items based
on an attribute list. The idea is that if you have attributes
that don't affect shaping, such as color or underline, to avoid
affecting shaping, you filter them out (<link linkend="pango-attr-list-filter"><function>pango_attr_list_filter()</function></link>),
apply the shaping process and then reapply them to the result using
this function.
</para>
<para>
All attributes that start or end inside a cluster are applied
to that cluster; for instance, if half of a cluster is underlined
and the other-half strikethrough, then the cluster will end
up with both underline and strikethrough attributes. In these
cases, it may happen that item->extra_attrs for some of the
result items can have multiple attributes of the same type.
</para>
<para>
This function takes ownership of <parameter>glyph_item</parameter>; it will be reused
as one of the elements in the list.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>glyph_item</parameter>&nbsp;:</term>
<listitem><simpara> a shaped item
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
<listitem><simpara> text that <parameter>list</parameter> applies to
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>list</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoAttrList"><type>PangoAttrList</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a list of glyph items resulting from splitting
  <parameter>glyph_item</parameter>. Free the elements using <link linkend="pango-glyph-item-free"><function>pango_glyph_item_free()</function></link>,
  the list using <link linkend="g-slist-free"><function>g_slist_free()</function></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.2
</para></refsect2>
<refsect2>
<title><anchor id="pango-glyph-item-letter-space" role="function" condition="since:1.6"/>pango_glyph_item_letter_space ()</title>
<indexterm role="1.6"><primary>pango_glyph_item_letter_space</primary></indexterm><programlisting><link linkend="void">void</link>                pango_glyph_item_letter_space       (<link linkend="PangoGlyphItem">PangoGlyphItem</link> *glyph_item,
                                                         const <link linkend="char">char</link> *text,
                                                         <link linkend="PangoLogAttr">PangoLogAttr</link> *log_attrs,
                                                         <link linkend="int">int</link> letter_spacing);</programlisting>
<para>
Adds spacing between the graphemes of <parameter>glyph_item</parameter> to
give the effect of typographic letter spacing.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>glyph_item</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoGlyphItem"><type>PangoGlyphItem</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
<listitem><simpara> text that <parameter>glyph_item</parameter> corresponds to
  (glyph_item->item->offset is an offset from the
   start of <parameter>text</parameter>)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>log_attrs</parameter>&nbsp;:</term>
<listitem><simpara> logical attributes for the item (the
  first logical attribute refers to the position
  before the first character in the item)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>letter_spacing</parameter>&nbsp;:</term>
<listitem><simpara> amount of letter spacing to add
  in Pango units. May be negative, though too large
  negative values will give ugly results.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.6
</para></refsect2>
<refsect2>
<title><anchor id="pango-glyph-item-free" role="function" condition="since:1.6"/>pango_glyph_item_free ()</title>
<indexterm role="1.6"><primary>pango_glyph_item_free</primary></indexterm><programlisting><link linkend="void">void</link>                pango_glyph_item_free               (<link linkend="PangoGlyphItem">PangoGlyphItem</link> *glyph_item);</programlisting>
<para>
Frees a <link linkend="PangoGlyphItem"><type>PangoGlyphItem</type></link> and memory to which it points.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>glyph_item</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoGlyphItem"><type>PangoGlyphItem</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.6
</para></refsect2>

</refsect1>




</refentry>
