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

<refnamediv>
<refname>Cairo Rendering</refname>
<refpurpose>Rendering with the Cairo backend</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

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



                    <link linkend="PangoCairoFont">PangoCairoFont</link>;
                    <link linkend="PangoCairoFontMap-struct">PangoCairoFontMap</link>;
<link linkend="PangoFontMap">PangoFontMap</link>*       <link linkend="pango-cairo-font-map-get-default">pango_cairo_font_map_get_default</link>    (void);
<link linkend="PangoFontMap">PangoFontMap</link>*       <link linkend="pango-cairo-font-map-new">pango_cairo_font_map_new</link>            (void);
<link linkend="PangoFontMap">PangoFontMap</link>*       <link linkend="pango-cairo-font-map-new-for-font-type">pango_cairo_font_map_new_for_font_type</link>
                                                        (<link linkend="cairo-font-type-t">cairo_font_type_t</link> fonttype);
<link linkend="cairo-font-type-t">cairo_font_type_t</link>   <link linkend="pango-cairo-font-map-get-font-type">pango_cairo_font_map_get_font_type</link>  (<link linkend="PangoCairoFontMap">PangoCairoFontMap</link> *fontmap);
<link linkend="void">void</link>                <link linkend="pango-cairo-font-map-set-resolution">pango_cairo_font_map_set_resolution</link> (<link linkend="PangoCairoFontMap">PangoCairoFontMap</link> *fontmap,
                                                         <link linkend="double">double</link> dpi);
<link linkend="double">double</link>              <link linkend="pango-cairo-font-map-get-resolution">pango_cairo_font_map_get_resolution</link> (<link linkend="PangoCairoFontMap">PangoCairoFontMap</link> *fontmap);
<link linkend="PangoContext">PangoContext</link>*       <link linkend="pango-cairo-font-map-create-context">pango_cairo_font_map_create_context</link> (<link linkend="PangoCairoFontMap">PangoCairoFontMap</link> *fontmap);
<link linkend="cairo-scaled-font-t">cairo_scaled_font_t</link>* <link linkend="pango-cairo-font-get-scaled-font">pango_cairo_font_get_scaled_font</link>   (<link linkend="PangoCairoFont">PangoCairoFont</link> *font);
<link linkend="void">void</link>                <link linkend="pango-cairo-context-set-resolution">pango_cairo_context_set_resolution</link>  (<link linkend="PangoContext">PangoContext</link> *context,
                                                         <link linkend="double">double</link> dpi);
<link linkend="double">double</link>              <link linkend="pango-cairo-context-get-resolution">pango_cairo_context_get_resolution</link>  (<link linkend="PangoContext">PangoContext</link> *context);
<link linkend="void">void</link>                <link linkend="pango-cairo-context-set-font-options">pango_cairo_context_set_font_options</link>
                                                        (<link linkend="PangoContext">PangoContext</link> *context,
                                                         const <link linkend="cairo-font-options-t">cairo_font_options_t</link> *options);
const <link linkend="cairo-font-options-t">cairo_font_options_t</link>* <link linkend="pango-cairo-context-get-font-options">pango_cairo_context_get_font_options</link>
                                                        (<link linkend="PangoContext">PangoContext</link> *context);
<link linkend="void">void</link>                (<link linkend="PangoCairoShapeRendererFunc">*PangoCairoShapeRendererFunc</link>)      (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoAttrShape">PangoAttrShape</link> *attr,
                                                         <link linkend="gboolean">gboolean</link> do_path,
                                                         <link linkend="gpointer">gpointer</link> data);
<link linkend="void">void</link>                <link linkend="pango-cairo-context-set-shape-renderer">pango_cairo_context_set_shape_renderer</link>
                                                        (<link linkend="PangoContext">PangoContext</link> *context,
                                                         <link linkend="PangoCairoShapeRendererFunc">PangoCairoShapeRendererFunc</link> func,
                                                         <link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GDestroyNotify">GDestroyNotify</link> dnotify);
<link linkend="PangoCairoShapeRendererFunc">PangoCairoShapeRendererFunc</link> <link linkend="pango-cairo-context-get-shape-renderer">pango_cairo_context_get_shape_renderer</link>
                                                        (<link linkend="PangoContext">PangoContext</link> *context,
                                                         <link linkend="gpointer">gpointer</link> *data);
<link linkend="void">void</link>                <link linkend="pango-cairo-update-context">pango_cairo_update_context</link>          (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoContext">PangoContext</link> *context);
<link linkend="PangoLayout">PangoLayout</link>*        <link linkend="pango-cairo-create-layout">pango_cairo_create_layout</link>           (<link linkend="cairo-t">cairo_t</link> *cr);
<link linkend="void">void</link>                <link linkend="pango-cairo-update-layout">pango_cairo_update_layout</link>           (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-cairo-show-glyph-string">pango_cairo_show_glyph_string</link>       (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoFont">PangoFont</link> *font,
                                                         <link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs);
<link linkend="void">void</link>                <link linkend="pango-cairo-show-layout-line">pango_cairo_show_layout_line</link>        (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoLayoutLine">PangoLayoutLine</link> *line);
<link linkend="void">void</link>                <link linkend="pango-cairo-show-layout">pango_cairo_show_layout</link>             (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-cairo-show-error-underline">pango_cairo_show_error_underline</link>    (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="double">double</link> x,
                                                         <link linkend="double">double</link> y,
                                                         <link linkend="double">double</link> width,
                                                         <link linkend="double">double</link> height);
<link linkend="void">void</link>                <link linkend="pango-cairo-glyph-string-path">pango_cairo_glyph_string_path</link>       (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoFont">PangoFont</link> *font,
                                                         <link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs);
<link linkend="void">void</link>                <link linkend="pango-cairo-layout-line-path">pango_cairo_layout_line_path</link>        (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoLayoutLine">PangoLayoutLine</link> *line);
<link linkend="void">void</link>                <link linkend="pango-cairo-layout-path">pango_cairo_layout_path</link>             (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoLayout">PangoLayout</link> *layout);
<link linkend="void">void</link>                <link linkend="pango-cairo-error-underline-path">pango_cairo_error_underline_path</link>    (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="double">double</link> x,
                                                         <link linkend="double">double</link> y,
                                                         <link linkend="double">double</link> width,
                                                         <link linkend="double">double</link> height);

</synopsis>
</refsynopsisdiv>

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

  <link linkend="GInterface">GInterface</link>
   +----PangoCairoFontMap
</synopsis>

</refsect1>

<refsect1 role="prerequisites">
<title role="prerequisites.title">Prerequisites</title>
<para>
PangoCairoFontMap requires
 <link linkend="PangoFontMap">PangoFontMap</link>.</para>

</refsect1>







<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
The <ulink url="http://cairographics.org">Cairo library</ulink> is a
vector graphics library with a powerful rendering model. It has such
features as anti-aliased primitives, alpha-compositing, and
gradients. Multiple backends for Cairo are available, to allow
rendering to images, to PDF files, and to the screen on X and on other
windowing systems. The functions in this section allow using Pango
to render to Cairo surfaces.
</para>
<para>
Using Pango with Cairo is straightforward. A <link linkend="PangoContext"><type>PangoContext</type></link> created
with <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link> can be used on any
Cairo context (cairo_t), but needs to be updated to match the
current transformation matrix and target surface of the Cairo context
using <link linkend="pango-cairo-update-context"><function>pango_cairo_update_context()</function></link>. The convenience functions
<link linkend="pango-cairo-create-layout"><function>pango_cairo_create_layout()</function></link> and <link linkend="pango-cairo-update-layout"><function>pango_cairo_update_layout()</function></link> handle
the common case where the program doesn't need to manipulate the
properties of the <link linkend="PangoContext"><type>PangoContext</type></link>.
</para>
<para>
When you get the metrics of a layout or of a piece of a layout using
functions such as <link linkend="pango-layout-get-extents"><function>pango_layout_get_extents()</function></link>, the reported metrics
are in user-space coordinates. If a piece of text is 10 units long,
and you call cairo_scale (cr, 2.0), it still is more-or-less 10
units long. However, the results will be affected by hinting
(that is, the process of adjusting the text to look good on the
pixel grid), so you shouldn't assume they are completely independent
of the current transformation matrix. Note that the basic metrics
functions in Pango report results in integer Pango units. To get
to the floating point units used in Cairo divide by <link linkend="PANGO-SCALE:CAPS"><literal>PANGO_SCALE</literal></link>.
</para>
<example id="rotated-example">
<title>Using Pango with Cairo</title>
<programlisting>
#<!-- -->include &lt;math.h>
#<!-- -->include &lt;pango/pangocairo.h>

static void
draw_text (cairo_t *cr)
{
#<!-- -->define RADIUS 150
#<!-- -->define N_WORDS 10
#<!-- -->define FONT "Sans Bold 27"

  PangoLayout *layout;
  PangoFontDescription *desc;
  int i;

  /* Center coordinates on the middle of the region we are drawing
   */
  cairo_translate (cr, RADIUS, RADIUS);

  /* Create a PangoLayout, set the font and text */
  layout = pango_cairo_create_layout (cr);
  
  pango_layout_set_text (layout, "Text", -1);
  desc = pango_font_description_from_string (FONT);
  pango_layout_set_font_description (layout, desc);
  pango_font_description_free (desc);

  /* Draw the layout N_WORDS times in a circle */
  for (i = 0; i &lt; N_WORDS; i++)
    {
      int width, height;
      double angle = (360. * i) / N_WORDS;
      double red;

      cairo_save (cr);

      /* Gradient from red at angle == 60 to blue at angle == 240 */
      red   = (1 + cos ((angle - 60) * G_PI / 180.)) / 2;
      cairo_set_source_rgb (cr, red, 0, 1.0 - red);

      cairo_rotate (cr, angle * G_PI / 180.);
    
      /* Inform Pango to re-layout the text with the new transformation */
      pango_cairo_update_layout (cr, layout);
    
      pango_layout_get_size (layout, &amp;width, &amp;height);
      cairo_move_to (cr, - ((double)width / PANGO_SCALE) / 2, - RADIUS);
      pango_cairo_show_layout (cr, layout);

      cairo_restore (cr);
    }

  /* free the layout object */
  g_object_unref (layout);
}

int main (int argc, char **argv)
{
  cairo_t *cr;
  char *filename;
  cairo_status_t status;
  cairo_surface_t *surface;

  if (argc != 2)
    {
      g_printerr ("Usage: cairosimple OUTPUT_FILENAME\n");
      return 1;
    }

  filename = argv[1];

  surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
					2 * RADIUS, 2 * RADIUS);
  cr = cairo_create (surface);
				  

  cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
  cairo_paint (cr);
  draw_text (cr);
  cairo_destroy (cr);
  
  status = cairo_surface_write_to_png (surface, filename);
  cairo_surface_destroy (surface);

  if (status != CAIRO_STATUS_SUCCESS)
    {
      g_printerr ("Could not save png to '%s'\n", filename);
      return 1;
    }

  return 0;
}
</programlisting>
</example>
<figure id="rotated-example-output">
  <title>Output of <xref linkend="rotated-example"/></title>
  <graphic fileref="rotated-text.png" format="PNG"/>
</figure>
</refsect1>

<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="PangoCairoFont" role="struct" condition="since:1.18"/>PangoCairoFont</title>
<indexterm role="1.18"><primary>PangoCairoFont</primary></indexterm><programlisting>typedef struct _PangoCairoFont PangoCairoFont;</programlisting>
<para>
<link linkend="PangoCairoFont"><type>PangoCairoFont</type></link> is an interface exported by fonts for
use with Cairo. The actual type of the font will depend
on the particular font technology Cairo was compiled to use.</para>
<para>

</para><para role="since">Since  1.18
</para></refsect2>
<refsect2>
<title><anchor id="PangoCairoFontMap-struct" role="struct"/>PangoCairoFontMap</title>
<indexterm role="1.10"><primary>PangoCairoFontMap</primary></indexterm><programlisting>typedef struct _PangoCairoFontMap PangoCairoFontMap;</programlisting>
<para>
<link linkend="PangoCairoFontMap"><type>PangoCairoFontMap</type></link> is an interface exported by font maps for
use with Cairo. The actual type of the font map will depend
on the particular font technology Cairo was compiled to use.</para>
<para>

</para><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-font-map-get-default" role="function" condition="since:1.10"/>pango_cairo_font_map_get_default ()</title>
<indexterm role="1.10"><primary>pango_cairo_font_map_get_default</primary></indexterm><programlisting><link linkend="PangoFontMap">PangoFontMap</link>*       pango_cairo_font_map_get_default    (void);</programlisting>
<para>
Gets a default font map to use with Cairo.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the default Cairo fontmap for <link linkend="Pango"><type>Pango</type></link>. This
 object is owned by Pango and must not be freed.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-font-map-new" role="function" condition="since:1.10"/>pango_cairo_font_map_new ()</title>
<indexterm role="1.10"><primary>pango_cairo_font_map_new</primary></indexterm><programlisting><link linkend="PangoFontMap">PangoFontMap</link>*       pango_cairo_font_map_new            (void);</programlisting>
<para>
Creates a new <link linkend="PangoCairoFontMap"><type>PangoCairoFontMap</type></link> object; a fontmap is used
to cache information about available fonts, and holds
certain global parameters such as the resolution.
In most cases, you can use <link linkend="pango-cairo-font-map-get-default"><function>pango_cairo_font_map_get_default()</function></link>
instead.
</para>
<para>
Note that the type of the returned object will depend
on the particular font backend Cairo was compiled to use;
You generally should only use the <link linkend="PangoFontMap"><type>PangoFontMap</type></link> and
<link linkend="PangoCairoFontMap"><type>PangoCairoFontMap</type></link> interfaces on the returned object.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly allocated <link linkend="PangoFontMap"><type>PangoFontMap</type></link>, which should
              be freed with <link linkend="g-object-unref"><function>g_object_unref()</function></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-font-map-new-for-font-type" role="function" condition="since:1.18"/>pango_cairo_font_map_new_for_font_type ()</title>
<indexterm role="1.18"><primary>pango_cairo_font_map_new_for_font_type</primary></indexterm><programlisting><link linkend="PangoFontMap">PangoFontMap</link>*       pango_cairo_font_map_new_for_font_type
                                                        (<link linkend="cairo-font-type-t">cairo_font_type_t</link> fonttype);</programlisting>
<para>
Creates a new <link linkend="PangoCairoFontMap"><type>PangoCairoFontMap</type></link> object of the type suitable
to be used with cairo font backend of type <parameter>fonttype</parameter>.
</para>
<para>
In most cases one should simply use @<link linkend="pango-cairo-font-map-new"><function>pango_cairo_font_map_new()</function></link>,
or in fact in most of those cases, just use
@<link linkend="pango-cairo-font-map-get-default"><function>pango_cairo_font_map_get_default()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>fonttype</parameter>&nbsp;:</term>
<listitem><simpara> desired <link linkend="cairo-font-type-t"><type>cairo_font_type_t</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly allocated <link linkend="PangoFontMap"><type>PangoFontMap</type></link> of suitable type
              which should be freed with <link linkend="g-object-unref"><function>g_object_unref()</function></link>,
              or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the requested cairo font backend is
              not supported.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.18
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-font-map-get-font-type" role="function" condition="since:1.18"/>pango_cairo_font_map_get_font_type ()</title>
<indexterm role="1.18"><primary>pango_cairo_font_map_get_font_type</primary></indexterm><programlisting><link linkend="cairo-font-type-t">cairo_font_type_t</link>   pango_cairo_font_map_get_font_type  (<link linkend="PangoCairoFontMap">PangoCairoFontMap</link> *fontmap);</programlisting>
<para>
Gets the type of Cairo font backend that <parameter>fontmap</parameter> uses.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>fontmap</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoCairoFontMap"><type>PangoCairoFontMap</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the <link linkend="cairo-font-type-t"><type>cairo_font_type_t</type></link> cairo font backend type

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.18
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-font-map-set-resolution" role="function" condition="since:1.10"/>pango_cairo_font_map_set_resolution ()</title>
<indexterm role="1.10"><primary>pango_cairo_font_map_set_resolution</primary></indexterm><programlisting><link linkend="void">void</link>                pango_cairo_font_map_set_resolution (<link linkend="PangoCairoFontMap">PangoCairoFontMap</link> *fontmap,
                                                         <link linkend="double">double</link> dpi);</programlisting>
<para>
Sets the resolution for the fontmap. This is a scale factor between
points specified in a <link linkend="PangoFontDescription"><type>PangoFontDescription</type></link> and Cairo units. The
default value is 96, meaning that a 10 point font will be 13
units high. (10 * 96. / 72. = 13.3).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>fontmap</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoCairoFontMap"><type>PangoCairoFontMap</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dpi</parameter>&nbsp;:</term>
<listitem><simpara> the resolution in "dots per inch". (Physical inches aren't actually
  involved; the terminology is conventional.)
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-font-map-get-resolution" role="function" condition="since:1.10"/>pango_cairo_font_map_get_resolution ()</title>
<indexterm role="1.10"><primary>pango_cairo_font_map_get_resolution</primary></indexterm><programlisting><link linkend="double">double</link>              pango_cairo_font_map_get_resolution (<link linkend="PangoCairoFontMap">PangoCairoFontMap</link> *fontmap);</programlisting>
<para>
Gets the resolution for the fontmap. See <link linkend="pango-cairo-font-map-set-resolution"><function>pango_cairo_font_map_set_resolution()</function></link></para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>fontmap</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoCairoFontMap"><type>PangoCairoFontMap</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the resolution in "dots per inch"

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-font-map-create-context" role="function" condition="since:1.10"/>pango_cairo_font_map_create_context ()</title>
<indexterm role="1.10"><primary>pango_cairo_font_map_create_context</primary></indexterm><programlisting><link linkend="PangoContext">PangoContext</link>*       pango_cairo_font_map_create_context (<link linkend="PangoCairoFontMap">PangoCairoFontMap</link> *fontmap);</programlisting>
<para>
Create a <link linkend="PangoContext"><type>PangoContext</type></link> for the given fontmap.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>fontmap</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoCairoFontMap"><type>PangoCairoFontMap</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly created context; free with <link linkend="g-object-unref"><function>g_object_unref()</function></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-font-get-scaled-font" role="function" condition="since:1.18"/>pango_cairo_font_get_scaled_font ()</title>
<indexterm role="1.18"><primary>pango_cairo_font_get_scaled_font</primary></indexterm><programlisting><link linkend="cairo-scaled-font-t">cairo_scaled_font_t</link>* pango_cairo_font_get_scaled_font   (<link linkend="PangoCairoFont">PangoCairoFont</link> *font);</programlisting>
<para>
Gets the <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> used by <parameter>font</parameter>.
The scaled font can be referenced and kept using
<link linkend="cairo-scaled-font-reference"><function>cairo_scaled_font_reference()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoFont"><type>PangoFont</type></link> from a <link linkend="PangoCairoFontMap"><type>PangoCairoFontMap</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> used by <parameter>font</parameter>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.18
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-context-set-resolution" role="function" condition="since:1.10"/>pango_cairo_context_set_resolution ()</title>
<indexterm role="1.10"><primary>pango_cairo_context_set_resolution</primary></indexterm><programlisting><link linkend="void">void</link>                pango_cairo_context_set_resolution  (<link linkend="PangoContext">PangoContext</link> *context,
                                                         <link linkend="double">double</link> dpi);</programlisting>
<para>
Sets the resolution for the context. This is a scale factor between
points specified in a <link linkend="PangoFontDescription"><type>PangoFontDescription</type></link> and Cairo units. The
default value is 96, meaning that a 10 point font will be 13
units high. (10 * 96. / 72. = 13.3).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>, from <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dpi</parameter>&nbsp;:</term>
<listitem><simpara> the resolution in "dots per inch". (Physical inches aren't actually
  involved; the terminology is conventional.) A 0 or negative value
  means to use the resolution from the font map.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-context-get-resolution" role="function" condition="since:1.10"/>pango_cairo_context_get_resolution ()</title>
<indexterm role="1.10"><primary>pango_cairo_context_get_resolution</primary></indexterm><programlisting><link linkend="double">double</link>              pango_cairo_context_get_resolution  (<link linkend="PangoContext">PangoContext</link> *context);</programlisting>
<para>
Gets the resolution for the context. See <link linkend="pango-cairo-context-set-resolution"><function>pango_cairo_context_set_resolution()</function></link></para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>, from <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the resolution in "dots per inch". A negative value will
 be returned if no resolution has previously been set.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-context-set-font-options" role="function" condition="since:1.10"/>pango_cairo_context_set_font_options ()</title>
<indexterm role="1.10"><primary>pango_cairo_context_set_font_options</primary></indexterm><programlisting><link linkend="void">void</link>                pango_cairo_context_set_font_options
                                                        (<link linkend="PangoContext">PangoContext</link> *context,
                                                         const <link linkend="cairo-font-options-t">cairo_font_options_t</link> *options);</programlisting>
<para>
Sets the font options used when rendering text with this context.
These options override any options that <link linkend="pango-cairo-update-context"><function>pango_cairo_update_context()</function></link>
derives from the target surface.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>, from <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>options</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="cairo-font-options-t"><type>cairo_font_options_t</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to unset any previously set
          options. A copy is made.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-context-get-font-options" role="function" condition="since:1.10"/>pango_cairo_context_get_font_options ()</title>
<indexterm role="1.10"><primary>pango_cairo_context_get_font_options</primary></indexterm><programlisting>const <link linkend="cairo-font-options-t">cairo_font_options_t</link>* pango_cairo_context_get_font_options
                                                        (<link linkend="PangoContext">PangoContext</link> *context);</programlisting>
<para>
Retrieves any font rendering options previously set with
<link linkend="pango-cairo-font-map-set-font-options"><function>pango_cairo_font_map_set_font_options()</function></link>. This functions not report options
that are derived from the target surface by <link linkend="pango-cairo-update-context"><function>pango_cairo_update_context()</function></link></para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>, from <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the font options previously set on the context, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
  if no options have been set. This value is owned by the context
  and must not be modified or freed.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="PangoCairoShapeRendererFunc" role="function"/>PangoCairoShapeRendererFunc ()</title>
<indexterm><primary>PangoCairoShapeRendererFunc</primary></indexterm><programlisting><link linkend="void">void</link>                (*PangoCairoShapeRendererFunc)      (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoAttrShape">PangoAttrShape</link> *attr,
                                                         <link linkend="gboolean">gboolean</link> do_path,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
Function type for rendering attributes of type <link linkend="PANGO-ATTR-SHAPE:CAPS"><literal>PANGO_ATTR_SHAPE</literal></link>
with Pango's Cairo renderer.
</para><variablelist role="params">
<varlistentry><term><parameter>cr</parameter>&nbsp;:</term>
<listitem><simpara>a Cairo context with current point set to where the shape should
     be rendered
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>attr</parameter>&nbsp;:</term>
<listitem><simpara>the <link linkend="PANGO-ATTR-SHAPE:CAPS"><literal>PANGO_ATTR_SHAPE</literal></link> to render
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>do_path</parameter>&nbsp;:</term>
<listitem><simpara>whether only the shape path should be appended to current
          path of <parameter>cr</parameter> and no filling/stroking done.  This will be set
	  to <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> when called from <link linkend="pango-cairo-layout-path"><function>pango_cairo_layout_path()</function></link> and
	  <link linkend="pango-cairo-layout-line-path"><function>pango_cairo_layout_line_path()</function></link> rendering functions.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&nbsp;:</term>
<listitem><simpara>user data passed to <link linkend="pango-cairo-context-set-shape-renderer"><function>pango_cairo_context_set_shape_renderer()</function></link>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="pango-cairo-context-set-shape-renderer" role="function" condition="since:1.18"/>pango_cairo_context_set_shape_renderer ()</title>
<indexterm role="1.18"><primary>pango_cairo_context_set_shape_renderer</primary></indexterm><programlisting><link linkend="void">void</link>                pango_cairo_context_set_shape_renderer
                                                        (<link linkend="PangoContext">PangoContext</link> *context,
                                                         <link linkend="PangoCairoShapeRendererFunc">PangoCairoShapeRendererFunc</link> func,
                                                         <link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GDestroyNotify">GDestroyNotify</link> dnotify);</programlisting>
<para>
Sets callback function for context to use for rendering attributes
of type <link linkend="PANGO-ATTR-SHAPE:CAPS"><literal>PANGO_ATTR_SHAPE</literal></link>.  See <link linkend="PangoCairoShapeRendererFunc"><type>PangoCairoShapeRendererFunc</type></link> for
details.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>, from <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>func</parameter>&nbsp;:</term>
<listitem><simpara> Callback function for rendering attributes of type
<link linkend="PANGO-ATTR-SHAPE:CAPS"><literal>PANGO_ATTR_SHAPE</literal></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to disable shape rendering.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&nbsp;:</term>
<listitem><simpara> User data that will be passed to <parameter>func</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dnotify</parameter>&nbsp;:</term>
<listitem><simpara> Callback that will be called when the
          context is freed to release <parameter>data</parameter>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.18
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-context-get-shape-renderer" role="function" condition="since:1.18"/>pango_cairo_context_get_shape_renderer ()</title>
<indexterm role="1.18"><primary>pango_cairo_context_get_shape_renderer</primary></indexterm><programlisting><link linkend="PangoCairoShapeRendererFunc">PangoCairoShapeRendererFunc</link> pango_cairo_context_get_shape_renderer
                                                        (<link linkend="PangoContext">PangoContext</link> *context,
                                                         <link linkend="gpointer">gpointer</link> *data);</programlisting>
<para>
Sets callback function for context to use for rendering attributes
of type <link linkend="PANGO-ATTR-SHAPE:CAPS"><literal>PANGO_ATTR_SHAPE</literal></link>.  See <link linkend="PangoCairoShapeRendererFunc"><type>PangoCairoShapeRendererFunc</type></link> for
details.
</para>
<para>
Retrieves callback function and associated user data for rendering
attributes of type <link linkend="PANGO-ATTR-SHAPE:CAPS"><literal>PANGO_ATTR_SHAPE</literal></link> as set by
<link linkend="pango-cairo-context-set-shape-renderer"><function>pango_cairo_context_set_shape_renderer()</function></link>, if any.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>, from <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&nbsp;:</term>
<listitem><simpara> Pointer to <link linkend="gpointer"><type>gpointer</type></link> to return user data
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the shape rendering callback previously set on the context, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
  if no shape rendering callback have been set.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.18
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-update-context" role="function" condition="since:1.10"/>pango_cairo_update_context ()</title>
<indexterm role="1.10"><primary>pango_cairo_update_context</primary></indexterm><programlisting><link linkend="void">void</link>                pango_cairo_update_context          (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoContext">PangoContext</link> *context);</programlisting>
<para>
Updates a <link linkend="PangoContext"><type>PangoContext</type></link> previously created for use with Cairo to
match the current transformation and target surface of a Cairo
context. If any layouts have been created for the context,
it's necessary to call <link linkend="pango-layout-context-changed"><function>pango_layout_context_changed()</function></link> on those
layouts.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cr</parameter>&nbsp;:</term>
<listitem><simpara> a Cairo context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>context</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoContext"><type>PangoContext</type></link>, from <link linkend="pango-cairo-font-map-create-context"><function>pango_cairo_font_map_create_context()</function></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-create-layout" role="function" condition="since:1.10"/>pango_cairo_create_layout ()</title>
<indexterm role="1.10"><primary>pango_cairo_create_layout</primary></indexterm><programlisting><link linkend="PangoLayout">PangoLayout</link>*        pango_cairo_create_layout           (<link linkend="cairo-t">cairo_t</link> *cr);</programlisting>
<para>
Creates a layout object set up to match the current transformation
and target surface of the Cairo context.  This layout can then be
used for text measurement with functions like
<link linkend="pango-layout-get-size"><function>pango_layout_get_size()</function></link> or drawing with functions like
<link linkend="pango-cairo-show-layout"><function>pango_cairo_show_layout()</function></link>. If you change the transformation
or target surface for <parameter>cr</parameter>, you need to call <link linkend="pango-cairo-update-layout"><function>pango_cairo_update_layout()</function></link>
</para>
<para>
This function is the most convenient way to use Cairo with Pango,
however it is slightly inefficient since it creates a separate
<link linkend="PangoContext"><type>PangoContext</type></link> object for each layout. This might matter in an
application that was laying out large amounts of text.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cr</parameter>&nbsp;:</term>
<listitem><simpara> a Cairo context
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly created <link linkend="PangoLayout"><type>PangoLayout</type></link>. Free with
  <link linkend="g-object-unref"><function>g_object_unref()</function></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-update-layout" role="function" condition="since:1.10"/>pango_cairo_update_layout ()</title>
<indexterm role="1.10"><primary>pango_cairo_update_layout</primary></indexterm><programlisting><link linkend="void">void</link>                pango_cairo_update_layout           (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Updates the private <link linkend="PangoContext"><type>PangoContext</type></link> of a <link linkend="PangoLayout"><type>PangoLayout</type></link> created with
<link linkend="pango-cairo-create-layout"><function>pango_cairo_create_layout()</function></link> to match the current transformation
and target surface of a Cairo context.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cr</parameter>&nbsp;:</term>
<listitem><simpara> a Cairo context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayout"><type>PangoLayout</type></link>, from <link linkend="pango-cairo-create-layout"><function>pango_cairo_create_layout()</function></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-show-glyph-string" role="function" condition="since:1.10"/>pango_cairo_show_glyph_string ()</title>
<indexterm role="1.10"><primary>pango_cairo_show_glyph_string</primary></indexterm><programlisting><link linkend="void">void</link>                pango_cairo_show_glyph_string       (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoFont">PangoFont</link> *font,
                                                         <link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs);</programlisting>
<para>
Draws the glyphs in <parameter>glyphs</parameter> in the specified cairo context.
The origin of the glyphs (the left edge of the baseline) will
be drawn at the current point of the cairo context.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cr</parameter>&nbsp;:</term>
<listitem><simpara> a Cairo context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoFont"><type>PangoFont</type></link> from a <link linkend="PangoCairoFontMap"><type>PangoCairoFontMap</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>glyphs</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-show-layout-line" role="function" condition="since:1.10"/>pango_cairo_show_layout_line ()</title>
<indexterm role="1.10"><primary>pango_cairo_show_layout_line</primary></indexterm><programlisting><link linkend="void">void</link>                pango_cairo_show_layout_line        (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoLayoutLine">PangoLayoutLine</link> *line);</programlisting>
<para>
Draws a <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link> in the specified cairo context.
The origin of the glyphs (the left edge of the line) will
be drawn at the current point of the cairo context.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cr</parameter>&nbsp;:</term>
<listitem><simpara> a Cairo context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>line</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-show-layout" role="function" condition="since:1.10"/>pango_cairo_show_layout ()</title>
<indexterm role="1.10"><primary>pango_cairo_show_layout</primary></indexterm><programlisting><link linkend="void">void</link>                pango_cairo_show_layout             (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Draws a <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link> in the specified cairo context.
The top-left corner of the <link linkend="PangoLayout"><type>PangoLayout</type></link> will be drawn
at the current point of the cairo context.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cr</parameter>&nbsp;:</term>
<listitem><simpara> a Cairo context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a Pango layout
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-show-error-underline" role="function" condition="since:1.14"/>pango_cairo_show_error_underline ()</title>
<indexterm role="1.14"><primary>pango_cairo_show_error_underline</primary></indexterm><programlisting><link linkend="void">void</link>                pango_cairo_show_error_underline    (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="double">double</link> x,
                                                         <link linkend="double">double</link> y,
                                                         <link linkend="double">double</link> width,
                                                         <link linkend="double">double</link> height);</programlisting>
<para>
Draw a squiggly line in the specified cairo context that approximately
covers the given rectangle in the style of an underline used to indicate a
spelling error.  (The width of the underline is rounded to an integer
number of up/down segments and the resulting rectangle is centered in the
original rectangle)</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cr</parameter>&nbsp;:</term>
<listitem><simpara> a Cairo context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara> The X coordinate of one corner of the rectangle
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara> The Y coordinate of one corner of the rectangle
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara> Non-negative width of the rectangle
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara> Non-negative height of the rectangle
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.14
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-glyph-string-path" role="function" condition="since:1.10"/>pango_cairo_glyph_string_path ()</title>
<indexterm role="1.10"><primary>pango_cairo_glyph_string_path</primary></indexterm><programlisting><link linkend="void">void</link>                pango_cairo_glyph_string_path       (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoFont">PangoFont</link> *font,
                                                         <link linkend="PangoGlyphString">PangoGlyphString</link> *glyphs);</programlisting>
<para>
Adds the glyphs in <parameter>glyphs</parameter> to the current path in the specified
cairo context. The origin of the glyphs (the left edge of the baseline)
will be at the current point of the cairo context.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cr</parameter>&nbsp;:</term>
<listitem><simpara> a Cairo context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoFont"><type>PangoFont</type></link> from a <link linkend="PangoCairoFontMap"><type>PangoCairoFontMap</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>glyphs</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-layout-line-path" role="function" condition="since:1.10"/>pango_cairo_layout_line_path ()</title>
<indexterm role="1.10"><primary>pango_cairo_layout_line_path</primary></indexterm><programlisting><link linkend="void">void</link>                pango_cairo_layout_line_path        (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoLayoutLine">PangoLayoutLine</link> *line);</programlisting>
<para>
Adds the text in <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link> to the current path in the
specified cairo context.  The origin of the glyphs (the left edge
of the line) will be at the current point of the cairo context.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cr</parameter>&nbsp;:</term>
<listitem><simpara> a Cairo context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>line</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="PangoLayoutLine"><type>PangoLayoutLine</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-layout-path" role="function" condition="since:1.10"/>pango_cairo_layout_path ()</title>
<indexterm role="1.10"><primary>pango_cairo_layout_path</primary></indexterm><programlisting><link linkend="void">void</link>                pango_cairo_layout_path             (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="PangoLayout">PangoLayout</link> *layout);</programlisting>
<para>
Adds the text in a <link linkend="PangoLayout"><type>PangoLayout</type></link> to the current path in the
specified cairo context.  The top-left corner of the <link linkend="PangoLayout"><type>PangoLayout</type></link>
will be at the current point of the cairo context.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cr</parameter>&nbsp;:</term>
<listitem><simpara> a Cairo context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>layout</parameter>&nbsp;:</term>
<listitem><simpara> a Pango layout
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.10
</para></refsect2>
<refsect2>
<title><anchor id="pango-cairo-error-underline-path" role="function" condition="since:1.14"/>pango_cairo_error_underline_path ()</title>
<indexterm role="1.14"><primary>pango_cairo_error_underline_path</primary></indexterm><programlisting><link linkend="void">void</link>                pango_cairo_error_underline_path    (<link linkend="cairo-t">cairo_t</link> *cr,
                                                         <link linkend="double">double</link> x,
                                                         <link linkend="double">double</link> y,
                                                         <link linkend="double">double</link> width,
                                                         <link linkend="double">double</link> height);</programlisting>
<para>
Add a squiggly line to the current path in the specified cairo context that
approximately covers the given rectangle in the style of an underline used
to indicate a spelling error.  (The width of the underline is rounded to an
integer number of up/down segments and the resulting rectangle is centered
in the original rectangle)</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cr</parameter>&nbsp;:</term>
<listitem><simpara> a Cairo context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara> The X coordinate of one corner of the rectangle
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara> The Y coordinate of one corner of the rectangle
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara> Non-negative width of the rectangle
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara> Non-negative height of the rectangle
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.14
</para></refsect2>

</refsect1>




</refentry>
