<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-pangocairocairofontmap">
  <refnamediv>
    <refname>pangocairo.CairoFontMap</refname>
    <refpurpose>object providing support for using font maps with
Cairo (new in PyGTK 2.8)</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>pangocairo.CairoFontMap</classname></ooclass>
      <ooclass><classname><link
linkend="class-pangocairocairofontmap">pangocairo.CairoFontMap</link></classname></ooclass>

      <constructorsynopsis language="python">
        <methodname><link linkend="constructor-pangocairocairofontmap">pangocairo.CairoFontMap</link></methodname>
      </constructorsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-pangocairocairofontmap--set-resolution">set_resolution</link></methodname>
        <methodparam><parameter role="keyword">dpi</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-pangocairocairofontmap--get-resolution">get_resolution</link></methodname>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-pangocairocairofontmap--create-context">create_context</link></methodname>
      </methodsynopsis>
    </classsynopsis>

<programlisting>
<emphasis role="bold">Functions</emphasis>

<methodsynopsis language="python">
    <methodname><link linkend="function-pangocairo--cairo-font-map-get-default">pangocairo.cairo_font_map_get_default</link></methodname>
  </methodsynopsis></programlisting>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-pangofontmap">pango.FontMap</link>
    +-- <link linkend="class-pangocairocairofontmap">pangocairo.CairoFontMap</link>
</synopsis>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para><link
linkend="class-pangocairocairofontmap"><classname>pangocairo.CairoFontMap</classname></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>Cairo is a graphics library that supports vector graphics and
image compositing that can be used with PyGTK. Since 2.8, GTK+ and Pango do
most of their drawing using Cairo. The Cairo drawing model and primitives
are similar to PostScript which uses an imaging model of painting on a two
dimensional surface.</para>

  </refsect1>

  <refsect1 id="constructor-pangocairocairofontmap">
    <title>Constructor</title>
 
    <programlisting><constructorsynopsis language="python">
        <methodname>pangocairo.CairoFontMap</methodname>
      </constructorsynopsis></programlisting>
     <variablelist>
      <varlistentry>
        <term><emphasis>Returns</emphasis>&nbsp;:</term>
        <listitem><simpara>a new <link linkend="class-pangocairocairofontmap"><classname>pangocairo.CairoFontMap</classname></link> object</simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a new <link
linkend="class-pangocairocairofontmap"><classname>pangocairo.CairoFontMap</classname></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 the <link
linkend="function-pangocairo--cairo-font-map-get-default"><function>pangocairo.cairo_font_map_get_default</function>()</link>
function 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="class-pangofontmap"><classname>pango.FontMap</classname></link> and
<link
linkend="class-pangocairocairofontmap"><classname>pangocairo.CairoFontMap</classname></link>
interfaces on the returned object.</para>
                                                                                
  </refsect1>
                                                                                
   <refsect1>
    <title>Methods</title>

    <refsect2 id="method-pangocairocairofontmap--set-resolution">
      <title>pangocairo.CairoFontMap.set_resolution</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_resolution</methodname>
	  <methodparam><parameter
			 role="keyword">dpi</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">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>

      <note>
        <para>This method is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <methodname>set_resolution</methodname>() method sets the
resolution for the fontmap to the value specified by
<parameter>dpi</parameter>. This is a scale factor between the points
specified in a <link
linkend="class-pangofontdescription"><classname>pango.FontDescription</classname></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>

    </refsect2>

    <refsect2 id="method-pangocairocairofontmap--get-resolution">
      <title>pangocairo.CairoFontMap.get_resolution</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_resolution</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara> the resolution in
"dots per inch"</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <methodname>get_resolution</methodname>() method returns the
resolution for the fontmap. See the <link
linkend="method-pangocairocairofontmap--set-resolution"><methodname>set_resolution</methodname>()</link>
method for more information.</para>

    </refsect2>

    <refsect2 id="method-pangocairocairofontmap--create-context">
      <title>pangocairo.CairoFontMap.create_context</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>create_context</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a new <link
linkend="class-pangocontext"><classname>pango.Context</classname></link>
object</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <methodname>create_context</methodname>() method creates a
new <link
linkend="class-pangocontext"><classname>pango.Context</classname></link>
object.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Functions</title>

    <refsect2 id="function-pangocairo--cairo-font-map-get-default">
      <title>pangocairo.cairo_font_map_get_default</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>pangocairo.cairo_font_map_get_default</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara> the default Cairo fontmap for
Pango.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This function is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <function>pangocairo.cairo_font_map_get_default</function>()
function returns the default font map to use with Cairo.</para>

    </refsect2>

  </refsect1>

</refentry>
