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

<refnamediv>
<refname>Layout Objects</refname>
<refpurpose>High-level layout driver objects</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv role="synopsis">
<title role="synopsis.title">Synopsis</title>
<anchor id="PangoLayout"/>
<synopsis>



                    <link linkend="PangoLayout-struct">PangoLayout</link>;
                    <link linkend="PangoLayoutIter">PangoLayoutIter</link>;
<link linkend="PangoLayout">PangoLayout</link>*        <link linkend="pango-layout-new">pango_layout_new</link>                    (<link linkend="PangoContext">PangoContext</link> *context);
<link linkend="PangoLayout">PangoLayout</link>*        <link linkend="pango-layout-copy">pango_layout_copy</link>                   (<link linkend="PangoLayout">PangoLayout</link> *src);
<link linkend="PangoContext">PangoContext</link>*       <link linkend="pango-layout-get-context">pango_layout_get_context</link>            (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-layout-context-changed">pango_layout_context_changed</link>        (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-layout-set-text">pango_layout_set_text</link>               (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         const <link linkend="char">char</link> *text,
                                                         <link linkend="int">int</link> length);
const <link linkend="char">char</link>*         <link linkend="pango-layout-get-text">pango_layout_get_text</link>               (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-layout-set-markup">pango_layout_set_markup</link>             (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         const <link linkend="char">char</link> *markup,
                                                         <link linkend="int">int</link> length);
<link linkend="void">void</link>                <link linkend="pango-layout-set-markup-with-accel">pango_layout_set_markup_with_accel</link>  (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         const <link linkend="char">char</link> *markup,
                                                         <link linkend="int">int</link> length,
                                                         <link linkend="gunichar">gunichar</link> accel_marker,
                                                         <link linkend="gunichar">gunichar</link> *accel_char);
<link linkend="void">void</link>                <link linkend="pango-layout-set-attributes">pango_layout_set_attributes</link>         (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoAttrList">PangoAttrList</link> *attrs);
<link linkend="PangoAttrList">PangoAttrList</link>*      <link linkend="pango-layout-get-attributes">pango_layout_get_attributes</link>         (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-layout-set-font-description">pango_layout_set_font_description</link>   (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         const <link linkend="PangoFontDescription">PangoFontDescription</link> *desc);
const <link linkend="PangoFontDescription">PangoFontDescription</link>* <link linkend="pango-layout-get-font-description">pango_layout_get_font_description</link>
                                                        (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-layout-set-width">pango_layout_set_width</link>              (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> width);
<link linkend="int">int</link>                 <link linkend="pango-layout-get-width">pango_layout_get_width</link>              (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-layout-set-wrap">pango_layout_set_wrap</link>               (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoWrapMode">PangoWrapMode</link> wrap);
<link linkend="PangoWrapMode">PangoWrapMode</link>       <link linkend="pango-layout-get-wrap">pango_layout_get_wrap</link>               (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-layout-is-wrapped">pango_layout_is_wrapped</link>             (<link linkend="PangoLayout">PangoLayout</link> *layout);
enum                <link linkend="PangoWrapMode">PangoWrapMode</link>;
#define             <link linkend="PANGO-TYPE-WRAP-MODE:CAPS">PANGO_TYPE_WRAP_MODE</link>
<link linkend="void">void</link>                <link linkend="pango-layout-set-ellipsize">pango_layout_set_ellipsize</link>          (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoEllipsizeMode">PangoEllipsizeMode</link> ellipsize);
<link linkend="PangoEllipsizeMode">PangoEllipsizeMode</link>  <link linkend="pango-layout-get-ellipsize">pango_layout_get_ellipsize</link>          (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-layout-is-ellipsized">pango_layout_is_ellipsized</link>          (<link linkend="PangoLayout">PangoLayout</link> *layout);
enum                <link linkend="PangoEllipsizeMode">PangoEllipsizeMode</link>;
#define             <link linkend="PANGO-TYPE-ELLIPSIZE-MODE:CAPS">PANGO_TYPE_ELLIPSIZE_MODE</link>
<link linkend="void">void</link>                <link linkend="pango-layout-set-indent">pango_layout_set_indent</link>             (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> indent);
<link linkend="int">int</link>                 <link linkend="pango-layout-get-indent">pango_layout_get_indent</link>             (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="int">int</link>                 <link linkend="pango-layout-get-spacing">pango_layout_get_spacing</link>            (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-layout-set-spacing">pango_layout_set_spacing</link>            (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> spacing);
<link linkend="void">void</link>                <link linkend="pango-layout-set-justify">pango_layout_set_justify</link>            (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="gboolean">gboolean</link> justify);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-layout-get-justify">pango_layout_get_justify</link>            (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-layout-set-auto-dir">pango_layout_set_auto_dir</link>           (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="gboolean">gboolean</link> auto_dir);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-layout-get-auto-dir">pango_layout_get_auto_dir</link>           (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-layout-set-alignment">pango_layout_set_alignment</link>          (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoAlignment">PangoAlignment</link> alignment);
<link linkend="PangoAlignment">PangoAlignment</link>      <link linkend="pango-layout-get-alignment">pango_layout_get_alignment</link>          (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-layout-set-tabs">pango_layout_set_tabs</link>               (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoTabArray">PangoTabArray</link> *tabs);
<link linkend="PangoTabArray">PangoTabArray</link>*      <link linkend="pango-layout-get-tabs">pango_layout_get_tabs</link>               (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-layout-set-single-paragraph-mode">pango_layout_set_single_paragraph_mode</link>
                                                        (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="gboolean">gboolean</link> setting);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-layout-get-single-paragraph-mode">pango_layout_get_single_paragraph_mode</link>
                                                        (<link linkend="PangoLayout">PangoLayout</link> *layout);
enum                <link linkend="PangoAlignment">PangoAlignment</link>;
#define             <link linkend="PANGO-TYPE-ALIGNMENT:CAPS">PANGO_TYPE_ALIGNMENT</link>
<link linkend="int">int</link>                 <link linkend="pango-layout-get-unknown-glyphs-count">pango_layout_get_unknown_glyphs_count</link>
                                                        (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-layout-get-log-attrs">pango_layout_get_log_attrs</link>          (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoLogAttr">PangoLogAttr</link> **attrs,
                                                         <link linkend="gint">gint</link> *n_attrs);
<link linkend="void">void</link>                <link linkend="pango-layout-index-to-pos">pango_layout_index_to_pos</link>           (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> index_,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *pos);
<link linkend="void">void</link>                <link linkend="pango-layout-index-to-line-x">pango_layout_index_to_line_x</link>        (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> index_,
                                                         <link linkend="gboolean">gboolean</link> trailing,
                                                         <link linkend="int">int</link> *line,
                                                         <link linkend="int">int</link> *x_pos);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-layout-xy-to-index">pango_layout_xy_to_index</link>            (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> x,
                                                         <link linkend="int">int</link> y,
                                                         <link linkend="int">int</link> *index_,
                                                         <link linkend="int">int</link> *trailing);
<link linkend="void">void</link>                <link linkend="pango-layout-get-cursor-pos">pango_layout_get_cursor_pos</link>         (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> index_,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *strong_pos,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *weak_pos);
<link linkend="void">void</link>                <link linkend="pango-layout-move-cursor-visually">pango_layout_move_cursor_visually</link>   (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="gboolean">gboolean</link> strong,
                                                         <link linkend="int">int</link> old_index,
                                                         <link linkend="int">int</link> old_trailing,
                                                         <link linkend="int">int</link> direction,
                                                         <link linkend="int">int</link> *new_index,
                                                         <link linkend="int">int</link> *new_trailing);
<link linkend="void">void</link>                <link linkend="pango-layout-get-extents">pango_layout_get_extents</link>            (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);
<link linkend="void">void</link>                <link linkend="pango-layout-get-pixel-extents">pango_layout_get_pixel_extents</link>      (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);
<link linkend="void">void</link>                <link linkend="pango-layout-get-size">pango_layout_get_size</link>               (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> *width,
                                                         <link linkend="int">int</link> *height);
<link linkend="void">void</link>                <link linkend="pango-layout-get-pixel-size">pango_layout_get_pixel_size</link>         (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> *width,
                                                         <link linkend="int">int</link> *height);
<link linkend="int">int</link>                 <link linkend="pango-layout-get-line-count">pango_layout_get_line_count</link>         (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="PangoLayoutLine">PangoLayoutLine</link>*    <link linkend="pango-layout-get-line">pango_layout_get_line</link>               (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> line);
<link linkend="PangoLayoutLine">PangoLayoutLine</link>*    <link linkend="pango-layout-get-line-readonly">pango_layout_get_line_readonly</link>      (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> line);
<link linkend="GSList">GSList</link>*             <link linkend="pango-layout-get-lines">pango_layout_get_lines</link>              (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="GSList">GSList</link>*             <link linkend="pango-layout-get-lines-readonly">pango_layout_get_lines_readonly</link>     (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="PangoLayoutIter">PangoLayoutIter</link>*    <link linkend="pango-layout-get-iter">pango_layout_get_iter</link>               (<link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-layout-iter-free">pango_layout_iter_free</link>              (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-layout-iter-next-run">pango_layout_iter_next_run</link>          (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-layout-iter-next-char">pango_layout_iter_next_char</link>         (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-layout-iter-next-cluster">pango_layout_iter_next_cluster</link>      (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-layout-iter-next-line">pango_layout_iter_next_line</link>         (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-layout-iter-at-last-line">pango_layout_iter_at_last_line</link>      (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);
<link linkend="int">int</link>                 <link linkend="pango-layout-iter-get-index">pango_layout_iter_get_index</link>         (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);
<link linkend="int">int</link>                 <link linkend="pango-layout-iter-get-baseline">pango_layout_iter_get_baseline</link>      (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);
<link linkend="PangoLayoutRun">PangoLayoutRun</link>*     <link linkend="pango-layout-iter-get-run">pango_layout_iter_get_run</link>           (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);
<link linkend="PangoLayoutRun">PangoLayoutRun</link>*     <link linkend="pango-layout-iter-get-run-readonly">pango_layout_iter_get_run_readonly</link>  (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);
<link linkend="PangoLayoutLine">PangoLayoutLine</link>*    <link linkend="pango-layout-iter-get-line">pango_layout_iter_get_line</link>          (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);
<link linkend="PangoLayoutLine">PangoLayoutLine</link>*    <link linkend="pango-layout-iter-get-line-readonly">pango_layout_iter_get_line_readonly</link> (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);
<link linkend="void">void</link>                <link linkend="pango-layout-iter-get-char-extents">pango_layout_iter_get_char_extents</link>  (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);
<link linkend="void">void</link>                <link linkend="pango-layout-iter-get-cluster-extents">pango_layout_iter_get_cluster_extents</link>
                                                        (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);
<link linkend="void">void</link>                <link linkend="pango-layout-iter-get-run-extents">pango_layout_iter_get_run_extents</link>   (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);
<link linkend="void">void</link>                <link linkend="pango-layout-iter-get-line-yrange">pango_layout_iter_get_line_yrange</link>   (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter,
                                                         <link linkend="int">int</link> *y0_,
                                                         <link linkend="int">int</link> *y1_);
<link linkend="void">void</link>                <link linkend="pango-layout-iter-get-line-extents">pango_layout_iter_get_line_extents</link>  (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);
<link linkend="void">void</link>                <link linkend="pango-layout-iter-get-layout-extents">pango_layout_iter_get_layout_extents</link>
                                                        (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);

                    <link linkend="PangoLayoutLine">PangoLayoutLine</link>;
typedef             <link linkend="PangoLayoutRun">PangoLayoutRun</link>;
<link linkend="PangoLayoutLine">PangoLayoutLine</link>*    <link linkend="pango-layout-line-ref">pango_layout_line_ref</link>               (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line);
<link linkend="void">void</link>                <link linkend="pango-layout-line-unref">pango_layout_line_unref</link>             (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line);
<link linkend="void">void</link>                <link linkend="pango-layout-line-get-extents">pango_layout_line_get_extents</link>       (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);
<link linkend="void">void</link>                <link linkend="pango-layout-line-get-pixel-extents">pango_layout_line_get_pixel_extents</link> (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *layout_line,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);
<link linkend="void">void</link>                <link linkend="pango-layout-line-index-to-x">pango_layout_line_index_to_x</link>        (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line,
                                                         <link linkend="int">int</link> index_,
                                                         <link linkend="gboolean">gboolean</link> trailing,
                                                         <link linkend="int">int</link> *x_pos);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-layout-line-x-to-index">pango_layout_line_x_to_index</link>        (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line,
                                                         <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-layout-line-get-x-ranges">pango_layout_line_get_x_ranges</link>      (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line,
                                                         <link linkend="int">int</link> start_index,
                                                         <link linkend="int">int</link> end_index,
                                                         <link linkend="int">int</link> **ranges,
                                                         <link linkend="int">int</link> *n_ranges);


</synopsis>
</refsynopsisdiv>

<refsect1 role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>

  <link linkend="GObject">GObject</link>
   +----PangoLayout
</synopsis>

</refsect1>








<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
While complete access to the layout capabilities of Pango is provided
using the detailed interfaces for itemization and shaping, using
that functionality directly involves writing a fairly large amount
of code. The objects and functions in this section provide a
high-level driver for formatting entire paragraphs of text
at once.
</para>
</refsect1>

<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="PangoLayout-struct" role="struct"/>PangoLayout</title>
<indexterm><primary>PangoLayout</primary></indexterm><programlisting>typedef struct _PangoLayout PangoLayout;</programlisting>
<para>
The <link linkend="PangoLayout"><type>PangoLayout</type></link> structure represents and entire paragraph
of text. It is initialized with a <link linkend="PangoContext"><type>PangoContext</type></link>, UTF-8 string
and set of attributes for that string. Once that is done, the
set of formatted lines can be extracted from the object,
the layout can be rendered, and conversion between logical
character positions within the layout's text, and the physical
position of the resulting glyphs can be made.
</para>

<para>
There are also a number of parameters to adjust the formatting
of a <link linkend="PangoLayout"><type>PangoLayout</type></link>, which are illustrated in <xref linkend="parameters"/>.
It is possible, as well, to ignore the 2-D setup, and simply
treat the results of a <link linkend="PangoLayout"><type>PangoLayout</type></link> as a list of lines.
</para>

<figure id="parameters">
<title>Adjustable parameters for a PangoLayout</title>
<graphic fileref="layout.gif" format="GIF"></graphic>
</figure>

<para>
The <link linkend="PangoLayout"><type>PangoLayout</type></link> structure is opaque, and has no user-visible
fields.
</para></refsect2>
<refsect2>
<title><anchor id="PangoLayoutIter" role="struct"/>PangoLayoutIter</title>
<indexterm><primary>PangoLayoutIter</primary></indexterm><programlisting>typedef struct _PangoLayoutIter PangoLayoutIter;</programlisting>
<para>
A <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link> structure can be used to
iterate over the visual extents of a <link linkend="PangoLayout"><type>PangoLayout</type></link>. 
</para>
<para>
The <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link> structure is opaque, and 
has no user-visible fields.
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-new" role="function"/>pango_layout_new ()</title>
<indexterm><primary>pango_layout_new</primary></indexterm><programlisting><link linkend="PangoLayout">PangoLayout</link>*        pango_layout_new                    (<link linkend="PangoContext">PangoContext</link> *context);</programlisting>
<para>
Create a new <link linkend="PangoLayout"><type>PangoLayout</type></link> object with attributes initialized to
default values for a particular <link linkend="PangoContext"><type>PangoContext</type></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly allocated <link linkend="PangoLayout"><type>PangoLayout</type></link>, with a reference
              count of one, which should be freed with
              <link linkend="g-object-unref"><function>g_object_unref()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-copy" role="function"/>pango_layout_copy ()</title>
<indexterm><primary>pango_layout_copy</primary></indexterm><programlisting><link linkend="PangoLayout">PangoLayout</link>*        pango_layout_copy                   (<link linkend="PangoLayout">PangoLayout</link> *src);</programlisting>
<para>
Does a deep copy-by-value of the <parameter>src</parameter> layout. The attribute list,
tab array, and text from the original layout are all copied by
value.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>src</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly allocated <link linkend="PangoLayout"><type>PangoLayout</type></link>, with a reference
              count of one, which should be freed with
              <link linkend="g-object-unref"><function>g_object_unref()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-context" role="function"/>pango_layout_get_context ()</title>
<indexterm><primary>pango_layout_get_context</primary></indexterm><programlisting><link linkend="PangoContext">PangoContext</link>*       pango_layout_get_context            (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Retrieves the <link linkend="PangoContext"><type>PangoContext</type></link> used for this layout.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the <link linkend="PangoContext"><type>PangoContext</type></link> for the layout. This does not
have an additional refcount added, so if you want to keep
a copy of this around, you must reference it yourself.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-context-changed" role="function"/>pango_layout_context_changed ()</title>
<indexterm><primary>pango_layout_context_changed</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_context_changed        (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Forces recomputation of any state in the <link linkend="PangoLayout"><type>PangoLayout</type></link> that
might depend on the layout's context. This function should
be called if you make changes to the context subsequent
to creating the layout.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-text" role="function"/>pango_layout_set_text ()</title>
<indexterm><primary>pango_layout_set_text</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_text               (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         const <link linkend="char">char</link> *text,
                                                         <link linkend="int">int</link> length);</programlisting>
<para>
Sets the text of the layout.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
<listitem><simpara> a valid UTF-8 string
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&nbsp;:</term>
<listitem><simpara> maximum length of <parameter>text</parameter>, in bytes. -1 indicates that
         the string is nul-terminated and the length should be
         calculated.  The text will also be truncated on
         encountering a nul-termination even when <parameter>length</parameter> is
         positive.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-text" role="function"/>pango_layout_get_text ()</title>
<indexterm><primary>pango_layout_get_text</primary></indexterm><programlisting>const <link linkend="char">char</link>*         pango_layout_get_text               (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Gets the text in the layout. The returned text should not
be freed or modified.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the text in the <parameter>layout</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-markup" role="function"/>pango_layout_set_markup ()</title>
<indexterm><primary>pango_layout_set_markup</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_markup             (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         const <link linkend="char">char</link> *markup,
                                                         <link linkend="int">int</link> length);</programlisting>
<para>
Same as <link linkend="pango-layout-set-markup-with-accel"><function>pango_layout_set_markup_with_accel()</function></link>, but
the markup text isn't scanned for accelerators.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>markup</parameter>&nbsp;:</term>
<listitem><simpara> marked-up text
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&nbsp;:</term>
<listitem><simpara> length of marked-up text in bytes, or -1 if <parameter>markup</parameter> is
nul-terminated
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-markup-with-accel" role="function"/>pango_layout_set_markup_with_accel ()</title>
<indexterm><primary>pango_layout_set_markup_with_accel</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_markup_with_accel  (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         const <link linkend="char">char</link> *markup,
                                                         <link linkend="int">int</link> length,
                                                         <link linkend="gunichar">gunichar</link> accel_marker,
                                                         <link linkend="gunichar">gunichar</link> *accel_char);</programlisting>
<para>
Sets the layout text and attribute list from marked-up text (see
<link linkend="PangoMarkupFormat">markup format</link>). Replaces
the current text and attribute list.
</para>
<para>
If <parameter>accel_marker</parameter> is nonzero, the given character will mark the
character following it as an accelerator. For example, <parameter>accel_marker</parameter>
might be an ampersand or underscore. All characters marked
as an accelerator will receive a <link linkend="PANGO-UNDERLINE-LOW:CAPS"><literal>PANGO_UNDERLINE_LOW</literal></link> attribute,
and the first character so marked will be returned in <parameter>accel_char</parameter>.
Two <parameter>accel_marker</parameter> characters following each other produce a single
literal <parameter>accel_marker</parameter> character.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>markup</parameter>&nbsp;:</term>
<listitem><simpara> marked-up text
(see <link linkend="PangoMarkupFormat">markup format</link>)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&nbsp;:</term>
<listitem><simpara> length of marked-up text in bytes, or -1 if <parameter>markup</parameter> is
nul-terminated
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>accel_marker</parameter>&nbsp;:</term>
<listitem><simpara> marker for accelerators in the text
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>accel_char</parameter>&nbsp;:</term>
<listitem><simpara> return location for first located accelerator, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-attributes" role="function"/>pango_layout_set_attributes ()</title>
<indexterm><primary>pango_layout_set_attributes</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_attributes         (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoAttrList">PangoAttrList</link> *attrs);</programlisting>
<para>
Sets the text attributes for a layout object.
References <parameter>attrs</parameter>, so the caller can unref its reference.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>attrs</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoAttrList"><type>PangoAttrList</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-attributes" role="function"/>pango_layout_get_attributes ()</title>
<indexterm><primary>pango_layout_get_attributes</primary></indexterm><programlisting><link linkend="PangoAttrList">PangoAttrList</link>*      pango_layout_get_attributes         (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Gets the attribute list for the layout, if any.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a <link linkend="PangoAttrList"><type>PangoAttrList</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-font-description" role="function"/>pango_layout_set_font_description ()</title>
<indexterm><primary>pango_layout_set_font_description</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_font_description   (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         const <link linkend="PangoFontDescription">PangoFontDescription</link> *desc);</programlisting>
<para>
Sets the default font description for the layout. If no font
description is set on the layout, the font description from
the layout's context is used.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>desc</parameter>&nbsp;:</term>
<listitem><simpara> the new <link linkend="PangoFontDescription"><type>PangoFontDescription</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to unset the
       current font description
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-font-description" role="function" condition="since:1.8"/>pango_layout_get_font_description ()</title>
<indexterm role="1.8"><primary>pango_layout_get_font_description</primary></indexterm><programlisting>const <link linkend="PangoFontDescription">PangoFontDescription</link>* pango_layout_get_font_description
                                                        (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Gets the font description for the layout, if any.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a pointer to the layout's font description,
 or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the font description from the layout's
 context is inherited. This value is owned by the layout
 and must not be modified or freed.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.8
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-width" role="function"/>pango_layout_set_width ()</title>
<indexterm><primary>pango_layout_set_width</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_width              (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> width);</programlisting>
<para>
Sets the width to which the lines of the <link linkend="PangoLayout"><type>PangoLayout</type></link> should wrap.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara> the desired width in Pango units, or -1 to indicate that no
        wrapping should be performed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-width" role="function"/>pango_layout_get_width ()</title>
<indexterm><primary>pango_layout_get_width</primary></indexterm><programlisting><link linkend="int">int</link>                 pango_layout_get_width              (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Gets the width to which the lines of the <link linkend="PangoLayout"><type>PangoLayout</type></link> should wrap.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the width, or -1 if no width set.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-wrap" role="function"/>pango_layout_set_wrap ()</title>
<indexterm><primary>pango_layout_set_wrap</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_wrap               (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoWrapMode">PangoWrapMode</link> wrap);</programlisting>
<para>
Sets the wrap mode; the wrap mode only has effect if a width
is set on the layout with <link linkend="pango-layout-set-width"><function>pango_layout_set_width()</function></link>. To turn off wrapping,
set the width to -1.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>wrap</parameter>&nbsp;:</term>
<listitem><simpara> the wrap mode
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-wrap" role="function"/>pango_layout_get_wrap ()</title>
<indexterm><primary>pango_layout_get_wrap</primary></indexterm><programlisting><link linkend="PangoWrapMode">PangoWrapMode</link>       pango_layout_get_wrap               (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Gets the wrap mode for the layout.
</para>
<para>
Use <link linkend="pango-layout-is-wrapped"><function>pango_layout_is_wrapped()</function></link> to query whether any paragraphs
were actually wrapped.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> active wrap mode.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-is-wrapped" role="function" condition="since:1.16"/>pango_layout_is_wrapped ()</title>
<indexterm role="1.16"><primary>pango_layout_is_wrapped</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_layout_is_wrapped             (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Queries whether the layout had to wrap any paragraphs.
</para>
<para>
This returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if a positive width is set on <parameter>layout</parameter>,
ellipsization mode of <parameter>layout</parameter> is set to <link linkend="PANGO-ELLIPSIZE-NONE:CAPS"><literal>PANGO_ELLIPSIZE_NONE</literal></link>,
and there are paragraphs exceeding the layout width that have
to be wrapped.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if any paragraphs had to be wrapped, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>
otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.16
</para></refsect2>
<refsect2>
<title><anchor id="PangoWrapMode" role="enum"/>enum PangoWrapMode</title>
<indexterm><primary>PangoWrapMode</primary></indexterm><programlisting>typedef enum {
  PANGO_WRAP_WORD,
  PANGO_WRAP_CHAR,
  PANGO_WRAP_WORD_CHAR
} PangoWrapMode;
</programlisting>
<para>
A <link linkend="PangoWrapMode"><type>PangoWrapMode</type></link> describes how to wrap the lines of a <link linkend="PangoLayout"><type>PangoLayout</type></link> to the desired width.
</para><variablelist role="enum">
<varlistentry>
<term><anchor id="PANGO-WRAP-WORD:CAPS" role="constant"/><literal>PANGO_WRAP_WORD</literal></term>
<listitem><simpara>wrap lines at word boundaries.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="PANGO-WRAP-CHAR:CAPS" role="constant"/><literal>PANGO_WRAP_CHAR</literal></term>
<listitem><simpara>wrap lines at character boundaries.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="PANGO-WRAP-WORD-CHAR:CAPS" role="constant"/><literal>PANGO_WRAP_WORD_CHAR</literal></term>
<listitem><simpara>wrap lines at word boundaries, but fall back to character boundaries if there is not 
enough space for a full word.

</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PANGO-TYPE-WRAP-MODE:CAPS" role="macro"/>PANGO_TYPE_WRAP_MODE</title>
<indexterm><primary>PANGO_TYPE_WRAP_MODE</primary></indexterm><programlisting>#define PANGO_TYPE_WRAP_MODE (pango_wrap_mode_get_type())
</programlisting>
<para>
The <link linkend="GObject"><type>GObject</type></link> type for <link linkend="PangoWrapMode"><type>PangoWrapMode</type></link>.
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-ellipsize" role="function" condition="since:1.6"/>pango_layout_set_ellipsize ()</title>
<indexterm role="1.6"><primary>pango_layout_set_ellipsize</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_ellipsize          (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoEllipsizeMode">PangoEllipsizeMode</link> ellipsize);</programlisting>
<para>
Sets the type of ellipsization being performed for <parameter>layout</parameter>.
Depending on the ellipsization mode <parameter>ellipsize</parameter> text is
removed from the start, middle, or end of lines so they
fit within the width of layout set with <link linkend="pango-layout-set-width"><function>pango_layout_set_width()</function></link>.
</para>
<para>
If the layout contains characters such as newlines that
force it to be layed out in multiple lines, then each line
is ellipsized separately.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ellipsize</parameter>&nbsp;:</term>
<listitem><simpara> the new ellipsization mode for <parameter>layout</parameter>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.6
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-ellipsize" role="function" condition="since:1.6"/>pango_layout_get_ellipsize ()</title>
<indexterm role="1.6"><primary>pango_layout_get_ellipsize</primary></indexterm><programlisting><link linkend="PangoEllipsizeMode">PangoEllipsizeMode</link>  pango_layout_get_ellipsize          (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Gets the type of ellipsization being performed for <parameter>layout</parameter>.
See <link linkend="pango-layout-set-ellipsize"><function>pango_layout_set_ellipsize()</function></link></para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the current ellipsization mode for <parameter>layout</parameter>.

Use <link linkend="pango-layout-is-ellipsized"><function>pango_layout_is_ellipsized()</function></link> to query whether any paragraphs
were actually ellipsized.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.6
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-is-ellipsized" role="function" condition="since:1.16"/>pango_layout_is_ellipsized ()</title>
<indexterm role="1.16"><primary>pango_layout_is_ellipsized</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_layout_is_ellipsized          (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Queries whether the layout had to ellipsize any paragraphs.
</para>
<para>
This returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the ellipsization mode for <parameter>layout</parameter>
is not <link linkend="PANGO-ELLIPSIZE-NONE:CAPS"><literal>PANGO_ELLIPSIZE_NONE</literal></link>, a positive width is set on <parameter>layout</parameter>,
and there are paragraphs exceeding that width that have to be
ellipsized.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if any paragraphs had to be ellipsized, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>
otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.16
</para></refsect2>
<refsect2>
<title><anchor id="PangoEllipsizeMode" role="enum"/>enum PangoEllipsizeMode</title>
<indexterm><primary>PangoEllipsizeMode</primary></indexterm><programlisting>typedef enum {
  PANGO_ELLIPSIZE_NONE,
  PANGO_ELLIPSIZE_START,
  PANGO_ELLIPSIZE_MIDDLE,
  PANGO_ELLIPSIZE_END
} PangoEllipsizeMode;
</programlisting>
<para>
The <link linkend="PangoEllipsizeMode"><type>PangoEllipsizeMode</type></link> type describes what sort of (if any)
ellipsization should be applied to a line of text. In
the ellipsization process characters are removed from the
text in order to make it fit to a given width and replaced
with an ellipsis.</para>
<para>

</para><variablelist role="enum">
<varlistentry>
<term><anchor id="PANGO-ELLIPSIZE-NONE:CAPS" role="constant"/><literal>PANGO_ELLIPSIZE_NONE</literal></term>
<listitem><simpara> No ellipsization
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="PANGO-ELLIPSIZE-START:CAPS" role="constant"/><literal>PANGO_ELLIPSIZE_START</literal></term>
<listitem><simpara> Omit characters at the start of the text
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="PANGO-ELLIPSIZE-MIDDLE:CAPS" role="constant"/><literal>PANGO_ELLIPSIZE_MIDDLE</literal></term>
<listitem><simpara> Omit characters in the middle of the text
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="PANGO-ELLIPSIZE-END:CAPS" role="constant"/><literal>PANGO_ELLIPSIZE_END</literal></term>
<listitem><simpara> Omit characters at the end of the text
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PANGO-TYPE-ELLIPSIZE-MODE:CAPS" role="macro"/>PANGO_TYPE_ELLIPSIZE_MODE</title>
<indexterm><primary>PANGO_TYPE_ELLIPSIZE_MODE</primary></indexterm><programlisting>#define PANGO_TYPE_ELLIPSIZE_MODE (pango_ellipsize_mode_get_type())
</programlisting>
<para>
The <link linkend="GObject"><type>GObject</type></link> type for <link linkend="PangoEllipsizeMode"><type>PangoEllipsizeMode</type></link>.
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-indent" role="function"/>pango_layout_set_indent ()</title>
<indexterm><primary>pango_layout_set_indent</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_indent             (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> indent);</programlisting>
<para>
Sets the width in Pango units to indent each paragraph. A negative value
of <parameter>indent</parameter> will produce a hanging indentation. That is, the first line will
have the full width, and subsequent lines will be indented by the
absolute value of <parameter>indent</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>indent</parameter>&nbsp;:</term>
<listitem><simpara> the amount by which to indent.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-indent" role="function"/>pango_layout_get_indent ()</title>
<indexterm><primary>pango_layout_get_indent</primary></indexterm><programlisting><link linkend="int">int</link>                 pango_layout_get_indent             (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Gets the paragraph indent width in Pango units. A negative value
indicates a hanging indentation.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the indent.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-spacing" role="function"/>pango_layout_get_spacing ()</title>
<indexterm><primary>pango_layout_get_spacing</primary></indexterm><programlisting><link linkend="int">int</link>                 pango_layout_get_spacing            (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Gets the amount of spacing in <link linkend="PangoGlyphUnit"><type>PangoGlyphUnit</type></link> between the lines of the
layout.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the spacing.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-spacing" role="function"/>pango_layout_set_spacing ()</title>
<indexterm><primary>pango_layout_set_spacing</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_spacing            (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> spacing);</programlisting>
<para>
Sets the amount of spacing in <link linkend="PangoGlyphUnit"><type>PangoGlyphUnit</type></link> between the lines of the
layout.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>spacing</parameter>&nbsp;:</term>
<listitem><simpara> the amount of spacing
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-justify" role="function"/>pango_layout_set_justify ()</title>
<indexterm><primary>pango_layout_set_justify</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_justify            (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="gboolean">gboolean</link> justify);</programlisting>
<para>
Sets whether each complete line should be stretched to
fill the entire width of the layout. This stretching is typically
done by adding whitespace, but for some scripts (such as Arabic),
the justification may be done in more complex ways, like extending
the characters.
</para>
<para>
Note that this setting is not implemented and so is ignored in Pango
older than 1.18.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>justify</parameter>&nbsp;:</term>
<listitem><simpara> whether the lines in the layout should be justified.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-justify" role="function"/>pango_layout_get_justify ()</title>
<indexterm><primary>pango_layout_get_justify</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_layout_get_justify            (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Gets whether each complete line should be stretched to fill the entire
width of the layout.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the justify.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-auto-dir" role="function" condition="since:1.4"/>pango_layout_set_auto_dir ()</title>
<indexterm role="1.4"><primary>pango_layout_set_auto_dir</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_auto_dir           (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="gboolean">gboolean</link> auto_dir);</programlisting>
<para>
Sets whether to calculate the bidirectional base direction
for the layout according to the contents of the layout;
when this flag is on (the default), then paragraphs in
   <parameter>layout</parameter> that begin with strong right-to-left characters
(Arabic and Hebrew principally), will have right-to-left
layout, paragraphs with letters from other scripts will
have left-to-right layout. Paragraphs with only neutral
characters get their direction from the surrounding paragraphs.
</para>
<para>
When <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>, the choice between left-to-right and
right-to-left layout is done according to the base direction
of the layout's <link linkend="PangoContext"><type>PangoContext</type></link>. (See <link linkend="pango-context-set-base-dir"><function>pango_context_set_base_dir()</function></link>).
</para>
<para>
When the auto-computed direction of a paragraph differs from the
base direction of the context, the interpretation of
<link linkend="PANGO-ALIGN-LEFT:CAPS"><literal>PANGO_ALIGN_LEFT</literal></link> and <link linkend="PANGO-ALIGN-RIGHT:CAPS"><literal>PANGO_ALIGN_RIGHT</literal></link> are swapped.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>auto_dir</parameter>&nbsp;:</term>
<listitem><simpara> if <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, compute the bidirectional base direction
  from the layout's contents.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.4
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-auto-dir" role="function" condition="since:1.4"/>pango_layout_get_auto_dir ()</title>
<indexterm role="1.4"><primary>pango_layout_get_auto_dir</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_layout_get_auto_dir           (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Gets whether to calculate the bidirectional base direction
for the layout according to the contents of the layout.
See <link linkend="pango-layout-set-auto-dir"><function>pango_layout_set_auto_dir()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the bidirectional base direction
  is computed from the layout's contents, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.4
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-alignment" role="function"/>pango_layout_set_alignment ()</title>
<indexterm><primary>pango_layout_set_alignment</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_alignment          (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoAlignment">PangoAlignment</link> alignment);</programlisting>
<para>
Sets the alignment for the layout: how partial lines are
positioned within the horizontal space available.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>alignment</parameter>&nbsp;:</term>
<listitem><simpara> the alignment
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-alignment" role="function"/>pango_layout_get_alignment ()</title>
<indexterm><primary>pango_layout_get_alignment</primary></indexterm><programlisting><link linkend="PangoAlignment">PangoAlignment</link>      pango_layout_get_alignment          (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Gets the alignment for the layout: how partial lines are
positioned within the horizontal space available.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the alignment.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-tabs" role="function"/>pango_layout_set_tabs ()</title>
<indexterm><primary>pango_layout_set_tabs</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_tabs               (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoTabArray">PangoTabArray</link> *tabs);</programlisting>
<para>
Sets the tabs to use for <parameter>layout</parameter>, overriding the default tabs
(by default, tabs are every 8 spaces). If <parameter>tabs</parameter> is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, the default
tabs are reinstated. <parameter>tabs</parameter> is copied into the layout; you must
free your copy of <parameter>tabs</parameter> yourself.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tabs</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoTabArray"><type>PangoTabArray</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-tabs" role="function"/>pango_layout_get_tabs ()</title>
<indexterm><primary>pango_layout_get_tabs</primary></indexterm><programlisting><link linkend="PangoTabArray">PangoTabArray</link>*      pango_layout_get_tabs               (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Gets the current <link linkend="PangoTabArray"><type>PangoTabArray</type></link> used by this layout. If no
<link linkend="PangoTabArray"><type>PangoTabArray</type></link> has been set, then the default tabs are in use
and <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned. Default tabs are every 8 spaces.
The return value should be freed with <link linkend="pango-tab-array-free"><function>pango_tab_array_free()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a copy of the tabs for this layout, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-set-single-paragraph-mode" role="function"/>pango_layout_set_single_paragraph_mode ()</title>
<indexterm><primary>pango_layout_set_single_paragraph_mode</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_set_single_paragraph_mode
                                                        (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="gboolean">gboolean</link> setting);</programlisting>
<para>
If <parameter>setting</parameter> is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, do not treat newlines and similar characters
as paragraph separators; instead, keep all text in a single paragraph,
and display a glyph for paragraph separator characters. Used when
you want to allow editing of newlines on a single text line.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>setting</parameter>&nbsp;:</term>
<listitem><simpara> new setting
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-single-paragraph-mode" role="function"/>pango_layout_get_single_paragraph_mode ()</title>
<indexterm><primary>pango_layout_get_single_paragraph_mode</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_layout_get_single_paragraph_mode
                                                        (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Obtains the value set by <link linkend="pango-layout-set-single-paragraph-mode"><function>pango_layout_set_single_paragraph_mode()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the layout does not break paragraphs at
paragraph separator characters, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PangoAlignment" role="enum"/>enum PangoAlignment</title>
<indexterm><primary>PangoAlignment</primary></indexterm><programlisting>typedef enum {
  PANGO_ALIGN_LEFT,
  PANGO_ALIGN_CENTER,
  PANGO_ALIGN_RIGHT
} PangoAlignment;
</programlisting>
<para>
A <link linkend="PangoAlignment"><type>PangoAlignment</type></link> describes how to align the lines of a <link linkend="PangoLayout"><type>PangoLayout</type></link> within the
available space. If the <link linkend="PangoLayout"><type>PangoLayout</type></link> is set to justify
using <link linkend="pango-layout-set-justify"><function>pango_layout_set_justify()</function></link>, this only has effect for partial lines.
</para><variablelist role="enum">
<varlistentry>
<term><anchor id="PANGO-ALIGN-LEFT:CAPS" role="constant"/><literal>PANGO_ALIGN_LEFT</literal></term>
<listitem><simpara>Put all available space on the right
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="PANGO-ALIGN-CENTER:CAPS" role="constant"/><literal>PANGO_ALIGN_CENTER</literal></term>
<listitem><simpara>Center the line within the available space
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="PANGO-ALIGN-RIGHT:CAPS" role="constant"/><literal>PANGO_ALIGN_RIGHT</literal></term>
<listitem><simpara>Put all available space on the left

</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PANGO-TYPE-ALIGNMENT:CAPS" role="macro"/>PANGO_TYPE_ALIGNMENT</title>
<indexterm><primary>PANGO_TYPE_ALIGNMENT</primary></indexterm><programlisting>#define PANGO_TYPE_ALIGNMENT (pango_alignment_get_type())
</programlisting>
<para>
The <link linkend="GObject"><type>GObject</type></link> type for <link linkend="PangoAlignment"><type>PangoAlignment</type></link>.
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-unknown-glyphs-count" role="function" condition="since:1.16"/>pango_layout_get_unknown_glyphs_count ()</title>
<indexterm role="1.16"><primary>pango_layout_get_unknown_glyphs_count</primary></indexterm><programlisting><link linkend="int">int</link>                 pango_layout_get_unknown_glyphs_count
                                                        (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Counts the number unknown glyphs in <parameter>layout</parameter>.  That is, zero if
glyphs for all characters in the layout text were found, or more
than zero otherwise.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The number of unknown glyphs in <parameter>layout</parameter>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.16
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-log-attrs" role="function"/>pango_layout_get_log_attrs ()</title>
<indexterm><primary>pango_layout_get_log_attrs</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_get_log_attrs          (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoLogAttr">PangoLogAttr</link> **attrs,
                                                         <link linkend="gint">gint</link> *n_attrs);</programlisting>
<para>
Retrieves an array of logical attributes for each character in
the <parameter>layout</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>attrs</parameter>&nbsp;:</term>
<listitem><simpara> location to store a pointer to an array of logical attributes
        This value must be freed with <link linkend="g-free"><function>g_free()</function></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_attrs</parameter>&nbsp;:</term>
<listitem><simpara> location to store the number of the attributes in the
          array. (The stored value will be one more than the total number
          of characters in the layout, since there need to be attributes
          corresponding to both the position before the first character
          and the position after the last character.)
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-index-to-pos" role="function"/>pango_layout_index_to_pos ()</title>
<indexterm><primary>pango_layout_index_to_pos</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_index_to_pos           (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> index_,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *pos);</programlisting>
<para>
Converts from an index within a <link linkend="PangoLayout"><type>PangoLayout</type></link> to the onscreen position
corresponding to the grapheme at that index, which is represented
as rectangle.  Note that <literal>pos->x</literal> is always the leading
edge of the grapheme and <literal>pos->x + pos->width</literal> the trailing
edge of the grapheme. If the directionality of the grapheme is right-to-left,
then <literal>pos->width</literal> will be negative.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index_</parameter>&nbsp;:</term>
<listitem><simpara> byte index within <parameter>layout</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pos</parameter>&nbsp;:</term>
<listitem><simpara> rectangle in which to store the position of the grapheme
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-index-to-line-x" role="function"/>pango_layout_index_to_line_x ()</title>
<indexterm><primary>pango_layout_index_to_line_x</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_index_to_line_x        (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> index_,
                                                         <link linkend="gboolean">gboolean</link> trailing,
                                                         <link linkend="int">int</link> *line,
                                                         <link linkend="int">int</link> *x_pos);</programlisting>
<para>
Converts from byte <parameter>index_</parameter> within the <parameter>layout</parameter> to line and X position.
(X position is measured from the left edge of the line)</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara>    a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index_</parameter>&nbsp;:</term>
<listitem><simpara>    the byte index of a grapheme within the layout.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>trailing</parameter>&nbsp;:</term>
<listitem><simpara>  an integer indicating the edge of the grapheme to retrieve the
            position of. If 0, the trailing edge of the grapheme, if &gt; 0,
            the leading of the grapheme.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>line</parameter>&nbsp;:</term>
<listitem><simpara>      location to store resulting line index. (which will
            between 0 and pango_layout_get_line_count(layout) - 1)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x_pos</parameter>&nbsp;:</term>
<listitem><simpara>     location to store resulting position within line
            (<link linkend="PANGO-SCALE:CAPS"><literal>PANGO_SCALE</literal></link> units per device unit)
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-xy-to-index" role="function"/>pango_layout_xy_to_index ()</title>
<indexterm><primary>pango_layout_xy_to_index</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_layout_xy_to_index            (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> x,
                                                         <link linkend="int">int</link> y,
                                                         <link linkend="int">int</link> *index_,
                                                         <link linkend="int">int</link> *trailing);</programlisting>
<para>
Converts from X and Y position within a layout to the byte
index to the character at that logical position. If the
Y position is not inside the layout, the closest position is chosen
(the position will be clamped inside the layout). If the
X position is not within the layout, then the start or the
end of the line is chosen as  described for <link linkend="pango-layout-x-to-index"><function>pango_layout_x_to_index()</function></link>.
If either the X or Y positions were not inside the layout, then the
function returns <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>; on an exact hit, it returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara>    a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara>         the X offset (in <link linkend="PangoGlyphUnit"><type>PangoGlyphUnit</type></link>)
            from the left edge of the layout.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara>         the Y offset (in <link linkend="PangoGlyphUnit"><type>PangoGlyphUnit</type></link>)
            from the top edge of the layout
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index_</parameter>&nbsp;:</term>
<listitem><simpara>    location to store calculated byte index
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>trailing</parameter>&nbsp;:</term>
<listitem><simpara>  location to store a integer indicating where
            in the grapheme the user clicked. It will either
            be zero, or the number of characters in the
            grapheme. 0 represents the trailing edge of the grapheme.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the coordinates were inside text, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-cursor-pos" role="function"/>pango_layout_get_cursor_pos ()</title>
<indexterm><primary>pango_layout_get_cursor_pos</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_get_cursor_pos         (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> index_,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *strong_pos,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *weak_pos);</programlisting>
<para>
Given an index within a layout, determines the positions that of the
strong and weak cursors if the insertion point is at that
index. The position of each cursor is stored as a zero-width
rectangle. The strong cursor location is the location where
characters of the directionality equal to the base direction of the
layout are inserted.  The weak cursor location is the location
where characters of the directionality opposite to the base
direction of the layout are inserted.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index_</parameter>&nbsp;:</term>
<listitem><simpara> the byte index of the cursor
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>strong_pos</parameter>&nbsp;:</term>
<listitem><simpara> location to store the strong cursor position (may be <link linkend="NULL:CAPS"><literal>NULL</literal></link>)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>weak_pos</parameter>&nbsp;:</term>
<listitem><simpara> location to store the weak cursor position (may be <link linkend="NULL:CAPS"><literal>NULL</literal></link>)
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-move-cursor-visually" role="function"/>pango_layout_move_cursor_visually ()</title>
<indexterm><primary>pango_layout_move_cursor_visually</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_move_cursor_visually   (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="gboolean">gboolean</link> strong,
                                                         <link linkend="int">int</link> old_index,
                                                         <link linkend="int">int</link> old_trailing,
                                                         <link linkend="int">int</link> direction,
                                                         <link linkend="int">int</link> *new_index,
                                                         <link linkend="int">int</link> *new_trailing);</programlisting>
<para>
Computes a new cursor position from an old position and
a count of positions to move visually. If <parameter>direction</parameter> is positive,
then the new strong cursor position will be one position
to the right of the old cursor position. If <parameter>direction</parameter> is negative,
then the new strong cursor position will be one position
to the left of the old cursor position.
</para>
<para>
In the presence of bidirectional text, the correspondence
between logical and visual order will depend on the direction
of the current run, and there may be jumps when the cursor
is moved off of the end of a run.
</para>
<para>
Motion here is in cursor positions, not in characters, so a
single call to <link linkend="pango-layout-move-cursor-visually"><function>pango_layout_move_cursor_visually()</function></link> may move the
cursor over multiple characters when multiple characters combine
to form a single grapheme.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara>       a <link linkend="PangoLayout"><type>PangoLayout</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>strong</parameter>&nbsp;:</term>
<listitem><simpara>       whether the moving cursor is the strong cursor or the
               weak cursor. The strong cursor is the cursor corresponding
               to text insertion in the base direction for the layout.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>old_index</parameter>&nbsp;:</term>
<listitem><simpara>    the byte index of the grapheme for the old index
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>old_trailing</parameter>&nbsp;:</term>
<listitem><simpara> if 0, the cursor was at the trailing edge of the
               grapheme indicated by <parameter>old_index</parameter>, if &gt; 0, the cursor
               was at the leading edge.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>direction</parameter>&nbsp;:</term>
<listitem><simpara>    direction to move cursor. A negative
               value indicates motion to the left.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>new_index</parameter>&nbsp;:</term>
<listitem><simpara>    location to store the new cursor byte index. A value of -1
               indicates that the cursor has been moved off the beginning
               of the layout. A value of <link linkend="G-MAXINT:CAPS"><literal>G_MAXINT</literal></link> indicates that
               the cursor has been moved off the end of the layout.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>new_trailing</parameter>&nbsp;:</term>
<listitem><simpara> number of characters to move forward from the location returned
               for <parameter>new_index</parameter> to get the position where the cursor should
               be displayed. This allows distinguishing the position at
               the beginning of one line from the position at the end
               of the preceding line. <parameter>new_index</parameter> is always on the line
               where the cursor should be displayed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-extents" role="function"/>pango_layout_get_extents ()</title>
<indexterm><primary>pango_layout_get_extents</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_get_extents            (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);</programlisting>
<para>
Computes the logical and ink extents of <parameter>layout</parameter>. Logical extents
are usually what you want for positioning things.  Note that both extents
may have non-zero x and y.  You may want to use those to offset where you
render the layout.  Not doing that is a very typical bug that shows up as
right-to-left layouts not being correctly positioned in a layout with
a set width.
</para>
<para>
The extents are given in layout coordinates and in Pango units; layout
coordinates begin at the top left corner of the layout.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara>   a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ink_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle used to store the extents of the layout 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 layout
		 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-layout-get-pixel-extents" role="function"/>pango_layout_get_pixel_extents ()</title>
<indexterm><primary>pango_layout_get_pixel_extents</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_get_pixel_extents      (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);</programlisting>
<para>
Computes the logical and ink extents of <parameter>layout</parameter> in device units.
This function just calls <link linkend="pango-layout-get-extents"><function>pango_layout_get_extents()</function></link> followed by
<link linkend="pango-extents-to-pixels"><function>pango_extents_to_pixels()</function></link>.
</para>
<para>
See <link linkend="pango-extents-to-pixels"><function>pango_extents_to_pixels()</function></link> for details of how ink and logical rectangles
are rounded to pixels.  In certain situations you may want to use
<link linkend="pango-layout-get-extents"><function>pango_layout_get_extents()</function></link> directly and pass the resulting logical
rectangle to <link linkend="pango-extents-to-pixels"><function>pango_extents_to_pixels()</function></link> as an ink <link linkend="rectangle"><function>rectangle()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara>   a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ink_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle used to store the extents of the layout 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
             layout 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-layout-get-size" role="function"/>pango_layout_get_size ()</title>
<indexterm><primary>pango_layout_get_size</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_get_size               (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> *width,
                                                         <link linkend="int">int</link> *height);</programlisting>
<para>
Determines the logical width and height of a <link linkend="PangoLayout"><type>PangoLayout</type></link>
in Pango units (device units scaled by <link linkend="PANGO-SCALE:CAPS"><literal>PANGO_SCALE</literal></link>). This
is simply a convenience function around <link linkend="pango-layout-get-extents"><function>pango_layout_get_extents()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara> location to store the logical width, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara> location to store the logical height, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-pixel-size" role="function"/>pango_layout_get_pixel_size ()</title>
<indexterm><primary>pango_layout_get_pixel_size</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_get_pixel_size         (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> *width,
                                                         <link linkend="int">int</link> *height);</programlisting>
<para>
Determines the logical width and height of a <link linkend="PangoLayout"><type>PangoLayout</type></link>
in device units. (<link linkend="pango-layout-get-size"><function>pango_layout_get_size()</function></link> returns the width
and height scaled by <link linkend="PANGO-SCALE:CAPS"><literal>PANGO_SCALE</literal></link>.) This
is simply a convenience function around
<link linkend="pango-layout-get-pixel-extents"><function>pango_layout_get_pixel_extents()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara> location to store the logical width, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara> location to store the logical height, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-line-count" role="function"/>pango_layout_get_line_count ()</title>
<indexterm><primary>pango_layout_get_line_count</primary></indexterm><programlisting><link linkend="int">int</link>                 pango_layout_get_line_count         (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Retrieves the count of lines for the <parameter>layout</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the line count.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-line" role="function"/>pango_layout_get_line ()</title>
<indexterm><primary>pango_layout_get_line</primary></indexterm><programlisting><link linkend="PangoLayoutLine">PangoLayoutLine</link>*    pango_layout_get_line               (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> line);</programlisting>
<para>
Retrieves a particular line from a <link linkend="PangoLayout"><type>PangoLayout</type></link>.
</para>
<para>
Use the faster <link linkend="pango-layout-get-line-readonly"><function>pango_layout_get_line_readonly()</function></link> if you do not plan
to modify the contents of the line (glyphs, glyph widths, etc.).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>line</parameter>&nbsp;:</term>
<listitem><simpara> the index of a line, which must be between 0 and
       <literal>pango_layout_get_line_count(layout) - 1</literal>, inclusive.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the requested <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the
              index is out of range. This layout line can
              be ref'ed and retained, but will become invalid
              if changes are made to the <link linkend="PangoLayout"><type>PangoLayout</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-line-readonly" role="function" condition="since:1.16"/>pango_layout_get_line_readonly ()</title>
<indexterm role="1.16"><primary>pango_layout_get_line_readonly</primary></indexterm><programlisting><link linkend="PangoLayoutLine">PangoLayoutLine</link>*    pango_layout_get_line_readonly      (<link linkend="PangoLayout">PangoLayout</link> *layout,
                                                         <link linkend="int">int</link> line);</programlisting>
<para>
Retrieves a particular line from a <link linkend="PangoLayout"><type>PangoLayout</type></link>.
</para>
<para>
This is a faster alternative to <link linkend="pango-layout-get-line"><function>pango_layout_get_line()</function></link>,
but the user is not expected
to modify the contents of the line (glyphs, glyph widths, etc.).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>line</parameter>&nbsp;:</term>
<listitem><simpara> the index of a line, which must be between 0 and
       <literal>pango_layout_get_line_count(layout) - 1</literal>, inclusive.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the requested <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the
              index is out of range. This layout line can
              be ref'ed and retained, but will become invalid
              if changes are made to the <link linkend="PangoLayout"><type>PangoLayout</type></link>.
              No changes should be made to the line.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.16
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-lines" role="function"/>pango_layout_get_lines ()</title>
<indexterm><primary>pango_layout_get_lines</primary></indexterm><programlisting><link linkend="GSList">GSList</link>*             pango_layout_get_lines              (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Returns the lines of the <parameter>layout</parameter> as a list.
</para>
<para>
Use the faster <link linkend="pango-layout-get-lines-readonly"><function>pango_layout_get_lines_readonly()</function></link> if you do not plan
to modify the contents of the lines (glyphs, glyph widths, etc.).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a <link linkend="GSList"><type>GSList</type></link> containing the lines in the layout. This
points to internal data of the <link linkend="PangoLayout"><type>PangoLayout</type></link> and must be used with
care. It will become invalid on any change to the layout's
text or properties.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-lines-readonly" role="function" condition="since:1.16"/>pango_layout_get_lines_readonly ()</title>
<indexterm role="1.16"><primary>pango_layout_get_lines_readonly</primary></indexterm><programlisting><link linkend="GSList">GSList</link>*             pango_layout_get_lines_readonly     (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Returns the lines of the <parameter>layout</parameter> as a list.
</para>
<para>
This is a faster alternative to <link linkend="pango-layout-get-lines"><function>pango_layout_get_lines()</function></link>,
but the user is not expected
to modify the contents of the lines (glyphs, glyph widths, etc.).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a <link linkend="GSList"><type>GSList</type></link> containing the lines in the layout. This
points to internal data of the <link linkend="PangoLayout"><type>PangoLayout</type></link> and must be used with
care. It will become invalid on any change to the layout's
text or properties.  No changes should be made to the lines.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.16
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-get-iter" role="function"/>pango_layout_get_iter ()</title>
<indexterm><primary>pango_layout_get_iter</primary></indexterm><programlisting><link linkend="PangoLayoutIter">PangoLayoutIter</link>*    pango_layout_get_iter               (<link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Returns an iterator to iterate over the visual extents of the layout.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the new <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link> that should be freed using
              <link linkend="pango-layout-iter-free"><function>pango_layout_iter_free()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-free" role="function"/>pango_layout_iter_free ()</title>
<indexterm><primary>pango_layout_iter_free</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_iter_free              (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);</programlisting>
<para>
Frees an iterator that's no longer in use.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-next-run" role="function"/>pango_layout_iter_next_run ()</title>
<indexterm><primary>pango_layout_iter_next_run</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_layout_iter_next_run          (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);</programlisting>
<para>
Moves <parameter>iter</parameter> forward to the next run in visual order. If <parameter>iter</parameter> was
already at the end of the layout, returns <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> whether motion was possible.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-next-char" role="function"/>pango_layout_iter_next_char ()</title>
<indexterm><primary>pango_layout_iter_next_char</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_layout_iter_next_char         (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);</programlisting>
<para>
Moves <parameter>iter</parameter> forward to the next character in visual order. If <parameter>iter</parameter> was already at
the end of the layout, returns <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> whether motion was possible.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-next-cluster" role="function"/>pango_layout_iter_next_cluster ()</title>
<indexterm><primary>pango_layout_iter_next_cluster</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_layout_iter_next_cluster      (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);</programlisting>
<para>
Moves <parameter>iter</parameter> forward to the next cluster in visual order. If <parameter>iter</parameter>
was already at the end of the layout, returns <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> whether motion was possible.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-next-line" role="function"/>pango_layout_iter_next_line ()</title>
<indexterm><primary>pango_layout_iter_next_line</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_layout_iter_next_line         (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);</programlisting>
<para>
Moves <parameter>iter</parameter> forward to the start of the next line. If <parameter>iter</parameter> is
already on the last line, returns <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> whether motion was possible.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-at-last-line" role="function"/>pango_layout_iter_at_last_line ()</title>
<indexterm><primary>pango_layout_iter_at_last_line</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_layout_iter_at_last_line      (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);</programlisting>
<para>
Determines whether <parameter>iter</parameter> is on the last line of the layout.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>iter</parameter> is on the last line.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-get-index" role="function"/>pango_layout_iter_get_index ()</title>
<indexterm><primary>pango_layout_iter_get_index</primary></indexterm><programlisting><link linkend="int">int</link>                 pango_layout_iter_get_index         (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);</programlisting>
<para>
Gets the current byte index. Note that iterating forward by char
moves in visual order, not logical order, so indexes may not be
sequential. Also, the index may be equal to the length of the text
in the layout, if on the <link linkend="NULL:CAPS"><literal>NULL</literal></link> run (see <link linkend="pango-layout-iter-get-run"><function>pango_layout_iter_get_run()</function></link>).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> current byte index.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-get-baseline" role="function"/>pango_layout_iter_get_baseline ()</title>
<indexterm><primary>pango_layout_iter_get_baseline</primary></indexterm><programlisting><link linkend="int">int</link>                 pango_layout_iter_get_baseline      (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);</programlisting>
<para>
Gets the Y position of the current line's baseline, in layout
coordinates (origin at top left of the entire layout).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> baseline of current line.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-get-run" role="function"/>pango_layout_iter_get_run ()</title>
<indexterm><primary>pango_layout_iter_get_run</primary></indexterm><programlisting><link linkend="PangoLayoutRun">PangoLayoutRun</link>*     pango_layout_iter_get_run           (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);</programlisting>
<para>
Gets the current run. When iterating by run, at the end of each
line, there's a position with a <link linkend="NULL:CAPS"><literal>NULL</literal></link> run, so this function can return
<link linkend="NULL:CAPS"><literal>NULL</literal></link>. The <link linkend="NULL:CAPS"><literal>NULL</literal></link> run at the end of each line ensures that all lines have
at least one run, even lines consisting of only a newline.
</para>
<para>
Use the faster <link linkend="pango-layout-iter-get-run-readonly"><function>pango_layout_iter_get_run_readonly()</function></link> if you do not plan
to modify the contents of the run (glyphs, glyph widths, etc.).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the current run.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-get-run-readonly" role="function" condition="since:1.16"/>pango_layout_iter_get_run_readonly ()</title>
<indexterm role="1.16"><primary>pango_layout_iter_get_run_readonly</primary></indexterm><programlisting><link linkend="PangoLayoutRun">PangoLayoutRun</link>*     pango_layout_iter_get_run_readonly  (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);</programlisting>
<para>
Gets the current run. When iterating by run, at the end of each
line, there's a position with a <link linkend="NULL:CAPS"><literal>NULL</literal></link> run, so this function can return
<link linkend="NULL:CAPS"><literal>NULL</literal></link>. The <link linkend="NULL:CAPS"><literal>NULL</literal></link> run at the end of each line ensures that all lines have
at least one run, even lines consisting of only a newline.
</para>
<para>
This is a faster alternative to <link linkend="pango-layout-iter-get-run"><function>pango_layout_iter_get_run()</function></link>,
but the user is not expected
to modify the contents of the run (glyphs, glyph widths, etc.).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the current run, that should not be modified.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.16
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-get-line" role="function"/>pango_layout_iter_get_line ()</title>
<indexterm><primary>pango_layout_iter_get_line</primary></indexterm><programlisting><link linkend="PangoLayoutLine">PangoLayoutLine</link>*    pango_layout_iter_get_line          (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);</programlisting>
<para>
Gets the current line.
</para>
<para>
Use the faster <link linkend="pango-layout-iter-get-line-readonly"><function>pango_layout_iter_get_line_readonly()</function></link> if you do not plan
to modify the contents of the line (glyphs, glyph widths, etc.).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the current line.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-get-line-readonly" role="function" condition="since:1.16"/>pango_layout_iter_get_line_readonly ()</title>
<indexterm role="1.16"><primary>pango_layout_iter_get_line_readonly</primary></indexterm><programlisting><link linkend="PangoLayoutLine">PangoLayoutLine</link>*    pango_layout_iter_get_line_readonly (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter);</programlisting>
<para>
Gets the current line for read-only access.
</para>
<para>
This is a faster alternative to <link linkend="pango-layout-iter-get-line"><function>pango_layout_iter_get_line()</function></link>,
but the user is not expected
to modify the contents of the line (glyphs, glyph widths, etc.).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the current line, that should not be modified.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.16
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-get-char-extents" role="function"/>pango_layout_iter_get_char_extents ()</title>
<indexterm><primary>pango_layout_iter_get_char_extents</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_iter_get_char_extents  (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);</programlisting>
<para>
Gets the extents of the current character, in layout coordinates
(origin is the top left of the entire layout). Only logical extents
can sensibly be obtained for characters; ink extents make sense only
down to the level of clusters.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>logical_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle to fill with logical extents
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-get-cluster-extents" role="function"/>pango_layout_iter_get_cluster_extents ()</title>
<indexterm><primary>pango_layout_iter_get_cluster_extents</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_iter_get_cluster_extents
                                                        (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);</programlisting>
<para>
Gets the extents of the current cluster, in layout coordinates
(origin is the top left of the entire layout).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ink_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle to fill with ink extents, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>logical_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle to fill with logical extents, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-get-run-extents" role="function"/>pango_layout_iter_get_run_extents ()</title>
<indexterm><primary>pango_layout_iter_get_run_extents</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_iter_get_run_extents   (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);</programlisting>
<para>
Gets the extents of the current run in layout coordinates
(origin is the top left of the entire layout).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ink_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle to fill with ink extents, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>logical_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle to fill with logical extents, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-get-line-yrange" role="function"/>pango_layout_iter_get_line_yrange ()</title>
<indexterm><primary>pango_layout_iter_get_line_yrange</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_iter_get_line_yrange   (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter,
                                                         <link linkend="int">int</link> *y0_,
                                                         <link linkend="int">int</link> *y1_);</programlisting>
<para>
Divides the vertical space in the <link linkend="PangoLayout"><type>PangoLayout</type></link> being iterated over
between the lines in the layout, and returns the space belonging to
the current line.  A line's range includes the line's logical
extents, plus half of the spacing above and below the line, if
<link linkend="pango-layout-set-spacing"><function>pango_layout_set_spacing()</function></link> has been called to set layout spacing.
The Y positions are in layout coordinates (origin at top left of the
entire layout).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y0_</parameter>&nbsp;:</term>
<listitem><simpara> start of line
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y1_</parameter>&nbsp;:</term>
<listitem><simpara> end of line
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-get-line-extents" role="function"/>pango_layout_iter_get_line_extents ()</title>
<indexterm><primary>pango_layout_iter_get_line_extents</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_iter_get_line_extents  (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);</programlisting>
<para>
Obtains the extents of the current line. <parameter>ink_rect</parameter> or <parameter>logical_rect</parameter>
can be <link linkend="NULL:CAPS"><literal>NULL</literal></link> if you aren't interested in them. Extents are in layout
coordinates (origin is the top-left corner of the entire
<link linkend="PangoLayout"><type>PangoLayout</type></link>).  Thus the extents returned by this function will be
the same width/height but not at the same x/y as the extents
returned from <link linkend="pango-layout-line-get-extents"><function>pango_layout_line_get_extents()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ink_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle to fill with ink extents, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>logical_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle to fill with logical extents, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-iter-get-layout-extents" role="function"/>pango_layout_iter_get_layout_extents ()</title>
<indexterm><primary>pango_layout_iter_get_layout_extents</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_iter_get_layout_extents
                                                        (<link linkend="PangoLayoutIter">PangoLayoutIter</link> *iter,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);</programlisting>
<para>
Obtains the extents of the <link linkend="PangoLayout"><type>PangoLayout</type></link> being iterated
over. <parameter>ink_rect</parameter> or <parameter>logical_rect</parameter> can be <link linkend="NULL:CAPS"><literal>NULL</literal></link> if you
aren't interested in them.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutIter"><type>PangoLayoutIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ink_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle to fill with ink extents, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>logical_rect</parameter>&nbsp;:</term>
<listitem><simpara> rectangle to fill with logical extents, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PangoLayoutLine" role="struct"/>PangoLayoutLine</title>
<indexterm><primary>PangoLayoutLine</primary></indexterm><programlisting>typedef struct {
  PangoLayout *layout;
  gint         start_index;     /* start of line as byte index into layout-&gt;text */
  gint         length;		/* length of line in bytes */
  GSList      *runs;
  guint        is_paragraph_start : 1;  /* TRUE if this is the first line of the paragraph */
  guint        resolved_dir : 3;  /* Resolved PangoDirection of line */
} PangoLayoutLine;
</programlisting>
<para>
The <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link> structure represents one of the lines resulting
from laying out a paragraph via <link linkend="PangoLayout"><type>PangoLayout</type></link>. <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link>
structures are obtained by calling <link linkend="pango-layout-get-line"><function>pango_layout_get_line()</function></link> and
are only valid until the text, attributes, or settings of the
parent <link linkend="PangoLayout"><type>PangoLayout</type></link> are modified.
</para>
<para>
Routines for rendering PangoLayout objects are provided in
code specific to each rendering system.
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="PangoLayout">PangoLayout</link>&nbsp;*<structfield>layout</structfield>;</term>
<listitem><simpara>the parent layout for this line
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gint">gint</link>&nbsp;<structfield>start_index</structfield>;</term>
<listitem><simpara>the start of the line as byte index into <parameter>layout->text</parameter>
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gint">gint</link>&nbsp;<structfield>length</structfield>;</term>
<listitem><simpara>the length of the line in bytes
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GSList">GSList</link>&nbsp;*<structfield>runs</structfield>;</term>
<listitem><simpara>a list containing the runs of the line in visual order
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="guint">guint</link>&nbsp;<structfield>is_paragraph_start</structfield>&nbsp;:&nbsp;1;</term>
<listitem><simpara><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if this is the first line of the paragraph
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="guint">guint</link>&nbsp;<structfield>resolved_dir</structfield>&nbsp;:&nbsp;3;</term>
<listitem><simpara>the resolved <link linkend="PangoDirection"><type>PangoDirection</type></link> of the line

</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="PangoLayoutRun" role="typedef"/>PangoLayoutRun</title>
<indexterm><primary>PangoLayoutRun</primary></indexterm><programlisting>typedef PangoGlyphItem PangoLayoutRun;
</programlisting>
<para>
The <link linkend="PangoLayoutRun"><type>PangoLayoutRun</type></link> structure represents a single run within
a <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link>; it is simply an alternate name for
<link linkend="PangoGlyphItem"><type>PangoGlyphItem</type></link>, present for backwards compatibility.
See the <link linkend="PangoGlyphItem"><type>PangoGlyphItem</type></link> docs for details on the fields.
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-line-ref" role="function" condition="since:1.10"/>pango_layout_line_ref ()</title>
<indexterm role="1.10"><primary>pango_layout_line_ref</primary></indexterm><programlisting><link linkend="PangoLayoutLine">PangoLayoutLine</link>*    pango_layout_line_ref               (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line);</programlisting>
<para>
Increase the reference count of a <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link> by one.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>line</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the line passed in.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-layout-line-unref" role="function"/>pango_layout_line_unref ()</title>
<indexterm><primary>pango_layout_line_unref</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_line_unref             (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line);</programlisting>
<para>
Decrease the reference count of a <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link> by one.
If the result is zero, the line and all associated memory
will be freed.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>line</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-line-get-extents" role="function"/>pango_layout_line_get_extents ()</title>
<indexterm><primary>pango_layout_line_get_extents</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_line_get_extents       (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);</programlisting>
<para>
Computes the logical and ink extents of a layout line. See
<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>line</parameter>&nbsp;:</term>
<listitem><simpara>     a <link linkend="PangoLayoutLine"><type>PangoLayoutLine</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>
</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>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-line-get-pixel-extents" role="function"/>pango_layout_line_get_pixel_extents ()</title>
<indexterm><primary>pango_layout_line_get_pixel_extents</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_line_get_pixel_extents (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *layout_line,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *ink_rect,
                                                         <link linkend="PangoRectangle">PangoRectangle</link> *logical_rect);</programlisting>
<para>
Computes the logical and ink extents of <parameter>layout_line</parameter> in device units.
This function just calls <link linkend="pango-layout-line-get-extents"><function>pango_layout_line_get_extents()</function></link> followed by
<link linkend="pango-extents-to-pixels"><function>pango_extents_to_pixels()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>layout_line</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutLine"><type>PangoLayoutLine</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>
</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>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-line-index-to-x" role="function"/>pango_layout_line_index_to_x ()</title>
<indexterm><primary>pango_layout_line_index_to_x</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_line_index_to_x        (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line,
                                                         <link linkend="int">int</link> index_,
                                                         <link linkend="gboolean">gboolean</link> trailing,
                                                         <link linkend="int">int</link> *x_pos);</programlisting>
<para>
Converts an index within a line to a X position.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>line</parameter>&nbsp;:</term>
<listitem><simpara>     a <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index_</parameter>&nbsp;:</term>
<listitem><simpara>   byte offset of a grapheme within the layout
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>trailing</parameter>&nbsp;:</term>
<listitem><simpara> an integer indicating the edge of the grapheme to retrieve
           the position of. If &gt; 0, the trailing edge of the grapheme,
           if 0, the leading of the grapheme.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x_pos</parameter>&nbsp;:</term>
<listitem><simpara> location to store the x_offset (in <link linkend="PangoGlyphUnit"><type>PangoGlyphUnit</type></link>)
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-line-x-to-index" role="function"/>pango_layout_line_x_to_index ()</title>
<indexterm><primary>pango_layout_line_x_to_index</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_layout_line_x_to_index        (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line,
                                                         <link linkend="int">int</link> x_pos,
                                                         <link linkend="int">int</link> *index_,
                                                         <link linkend="int">int</link> *trailing);</programlisting>
<para>
Converts from x offset to the byte index of the corresponding
character within the text of the layout. If <parameter>x_pos</parameter> is outside the line,
<parameter>index_</parameter> and <parameter>trailing</parameter> will point to the very first or very last position
in the line. This determination is based on the resolved direction
of the paragraph; for example, if the resolved direction is
right-to-left, then an X position to the right of the line (after it)
results in 0 being stored in <parameter>index_</parameter> and <parameter>trailing</parameter>. An X position to the
left of the line results in <parameter>index_</parameter> pointing to the (logical) last
grapheme in the line and <parameter>trailing</parameter> being set to the number of characters
in that grapheme. The reverse is true for a left-to-right line.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>line</parameter>&nbsp;:</term>
<listitem><simpara>      a <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></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>)
            from the left edge of the line.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>index_</parameter>&nbsp;:</term>
<listitem><simpara>    location to store calculated byte index for
            the grapheme in which the user clicked.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>trailing</parameter>&nbsp;:</term>
<listitem><simpara>  location to store an integer indicating where
            in the grapheme the user clicked. It will either
            be zero, or the number of characters in the
            grapheme. 0 represents the leading edge of the grapheme.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if <parameter>x_pos</parameter> was outside the line, <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if inside
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-layout-line-get-x-ranges" role="function"/>pango_layout_line_get_x_ranges ()</title>
<indexterm><primary>pango_layout_line_get_x_ranges</primary></indexterm><programlisting><link linkend="void">void</link>                pango_layout_line_get_x_ranges      (<link linkend="PangoLayoutLine">PangoLayoutLine</link> *line,
                                                         <link linkend="int">int</link> start_index,
                                                         <link linkend="int">int</link> end_index,
                                                         <link linkend="int">int</link> **ranges,
                                                         <link linkend="int">int</link> *n_ranges);</programlisting>
<para>
Gets a list of visual ranges corresponding to a given logical range.
This list is not necessarily minimal - there may be consecutive
ranges which are adjacent. The ranges will be sorted from left to
right. The ranges are with respect to the left edge of the entire
layout, not with respect to the line.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>line</parameter>&nbsp;:</term>
<listitem><simpara>        a <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start_index</parameter>&nbsp;:</term>
<listitem><simpara> Start byte index of the logical range. If this value
              is less than the start index for the line, then
              the first range will extend all the way to the leading
              edge of the layout. Otherwise it will start at the
              leading edge of the first character.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end_index</parameter>&nbsp;:</term>
<listitem><simpara>   Ending byte index of the logical range. If this value
              is greater than the end index for the line, then
              the last range will extend all the way to the trailing
              edge of the layout. Otherwise, it will end at the
              trailing edge of the last character.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ranges</parameter>&nbsp;:</term>
<listitem><simpara>      location to store a pointer to an array of ranges.
              The array will be of length <literal>2*n_ranges</literal>,
              with each range starting at <literal>(*ranges)[2*n]</literal>
              and of width <literal>(*ranges)[2*n + 1] - (*ranges)[2*n]</literal>.
              This array must be freed with <link linkend="g-free"><function>g_free()</function></link>. The coordinates are relative
              to the layout and are in <link linkend="PangoGlyphUnit"><type>PangoGlyphUnit</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_ranges</parameter>&nbsp;:</term>
<listitem><simpara> The number of ranges stored in <parameter>ranges</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
