<?xml version='1.0' encoding='UTF-8'?> 
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
                "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="cairo-cairo-font-face-t">
<refmeta>
<refentrytitle role="top_of_page">cairo_font_face_t</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAIRO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>cairo_font_face_t</refname>
<refpurpose>Base class for fonts</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

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

<synopsis>



typedef             <link linkend="cairo-font-face-t">cairo_font_face_t</link>;
<link linkend="cairo-font-face-t">cairo_font_face_t</link>*  <link linkend="cairo-font-face-reference">cairo_font_face_reference</link>           (<link linkend="cairo-font-face-t">cairo_font_face_t</link> *font_face);
<link linkend="void">void</link>                <link linkend="cairo-font-face-destroy">cairo_font_face_destroy</link>             (<link linkend="cairo-font-face-t">cairo_font_face_t</link> *font_face);
<link linkend="cairo-status-t">cairo_status_t</link>      <link linkend="cairo-font-face-status">cairo_font_face_status</link>              (<link linkend="cairo-font-face-t">cairo_font_face_t</link> *font_face);
enum                <link linkend="cairo-font-type-t">cairo_font_type_t</link>;
<link linkend="cairo-font-type-t">cairo_font_type_t</link>   <link linkend="cairo-font-face-get-type">cairo_font_face_get_type</link>            (<link linkend="cairo-font-face-t">cairo_font_face_t</link> *font_face);
unsigned <link linkend="int">int</link>        <link linkend="cairo-font-face-get-reference-count">cairo_font_face_get_reference_count</link> (<link linkend="cairo-font-face-t">cairo_font_face_t</link> *font_face);
<link linkend="cairo-status-t">cairo_status_t</link>      <link linkend="cairo-font-face-set-user-data">cairo_font_face_set_user_data</link>       (<link linkend="cairo-font-face-t">cairo_font_face_t</link> *font_face,
                                                         const <link linkend="cairo-user-data-key-t">cairo_user_data_key_t</link> *key,
                                                         <link linkend="void">void</link> *user_data,
                                                         <link linkend="cairo-destroy-func-t">cairo_destroy_func_t</link> destroy);
<link linkend="void">void</link>*               <link linkend="cairo-font-face-get-user-data">cairo_font_face_get_user_data</link>       (<link linkend="cairo-font-face-t">cairo_font_face_t</link> *font_face,
                                                         const <link linkend="cairo-user-data-key-t">cairo_user_data_key_t</link> *key);
</synopsis>
</refsynopsisdiv>









<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>

</para>
</refsect1>

<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="cairo-font-face-t" role="typedef"/>cairo_font_face_t</title>
<indexterm><primary>cairo_font_face_t</primary></indexterm><programlisting>typedef struct _cairo_font_face cairo_font_face_t;
</programlisting>
<para>
A <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link> specifies all aspects of a font other
than the size or font matrix (a font matrix is used to distort
a font by sheering it or scaling it unequally in the two
directions) . A font face can be set on a <link linkend="cairo-t"><type>cairo_t</type></link> by using
<link linkend="cairo-set-font-face"><function>cairo_set_font_face()</function></link>; the size and font matrix are set with
<link linkend="cairo-set-font-size"><function>cairo_set_font_size()</function></link> and <link linkend="cairo-set-font-matrix"><function>cairo_set_font_matrix()</function></link>.
</para>
<para>
There are various types of font faces, depending on the
<firstterm>font backend</firstterm> they use. The type of a
font face can be queried using <link linkend="cairo-font-face-get-type"><function>cairo_font_face_get_type()</function></link>.
</para>
<para>
Memory management of <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link> is done with
<link linkend="cairo-font-face-reference"><function>cairo_font_face_reference()</function></link> and <link linkend="cairo-font-face-destroy"><function>cairo_font_face_destroy()</function></link>.</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="cairo-font-face-reference" role="function"/>cairo_font_face_reference ()</title>
<indexterm><primary>cairo_font_face_reference</primary></indexterm><programlisting><link linkend="cairo-font-face-t">cairo_font_face_t</link>*  cairo_font_face_reference           (<link linkend="cairo-font-face-t">cairo_font_face_t</link> *font_face);</programlisting>
<para>
Increases the reference count on <parameter>font_face</parameter> by one. This prevents
<parameter>font_face</parameter> from being destroyed until a matching call to
<link linkend="cairo-font-face-destroy"><function>cairo_font_face_destroy()</function></link> is made.
</para>
<para>
The number of references to a <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link> can be get using
<link linkend="cairo-font-face-get-reference-count"><function>cairo_font_face_get_reference_count()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>font_face</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link>, (may be <link linkend="NULL:CAPS"><literal>NULL</literal></link> in which case this
function does nothing).
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the referenced <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="cairo-font-face-destroy" role="function"/>cairo_font_face_destroy ()</title>
<indexterm><primary>cairo_font_face_destroy</primary></indexterm><programlisting><link linkend="void">void</link>                cairo_font_face_destroy             (<link linkend="cairo-font-face-t">cairo_font_face_t</link> *font_face);</programlisting>
<para>
Decreases the reference count on <parameter>font_face</parameter> by one. If the result
is zero, then <parameter>font_face</parameter> and all associated resources are freed.
See <link linkend="cairo-font-face-reference"><function>cairo_font_face_reference()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>font_face</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="cairo-font-face-status" role="function"/>cairo_font_face_status ()</title>
<indexterm><primary>cairo_font_face_status</primary></indexterm><programlisting><link linkend="cairo-status-t">cairo_status_t</link>      cairo_font_face_status              (<link linkend="cairo-font-face-t">cairo_font_face_t</link> *font_face);</programlisting>
<para>
Checks whether an error has previously occurred for this
font face</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>font_face</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="CAIRO-STATUS-SUCCESS:CAPS"><literal>CAIRO_STATUS_SUCCESS</literal></link> or another error such as
  <link linkend="CAIRO-STATUS-NO-MEMORY:CAPS"><literal>CAIRO_STATUS_NO_MEMORY</literal></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="cairo-font-type-t" role="enum" condition="since:1.2"/>enum cairo_font_type_t</title>
<indexterm role="1.2"><primary>cairo_font_type_t</primary></indexterm><programlisting>typedef enum _cairo_font_type {
    CAIRO_FONT_TYPE_TOY,
    CAIRO_FONT_TYPE_FT,
    CAIRO_FONT_TYPE_WIN32,
    CAIRO_FONT_TYPE_ATSUI
} cairo_font_type_t;
</programlisting>
<para>
<link linkend="cairo-font-type-t"><type>cairo_font_type_t</type></link> is used to describe the type of a given font
face or scaled font. The font types are also known as "font
backends" within cairo.
</para>
<para>
The type of a font face is determined by the function used to
create it, which will generally be of the form
cairo_<emphasis>type</emphasis>_font_face_create. The font face type can be queried
with <link linkend="cairo-font-face-get-type"><function>cairo_font_face_get_type()</function></link>
</para>
<para>
The various cairo_font_face functions can be used with a font face
of any type.
</para>
<para>
The type of a scaled font is determined by the type of the font
face passed to cairo_scaled_font_create. The scaled font type can
be queried with <link linkend="cairo-scaled-font-get-type"><function>cairo_scaled_font_get_type()</function></link>
</para>
<para>
The various cairo_scaled_font functions can be used with scaled
fonts of any type, but some font backends also provide
type-specific functions that must only be called with a scaled font
of the appropriate type. These functions have names that begin with
cairo_<emphasis>type</emphasis>_scaled_font such as cairo_ft_scaled_font_lock_face.
</para>
<para>
The behavior of calling a type-specific function with a scaled font
of the wrong type is undefined.
</para>
<para>
New entries may be added in future versions.</para>
<para>

</para><variablelist role="enum">
<varlistentry>
<term><anchor id="CAIRO-FONT-TYPE-TOY:CAPS" role="constant"/><literal>CAIRO_FONT_TYPE_TOY</literal></term>
<listitem><simpara> The font was created using cairo's toy font api
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="CAIRO-FONT-TYPE-FT:CAPS" role="constant"/><literal>CAIRO_FONT_TYPE_FT</literal></term>
<listitem><simpara> The font is of type FreeType
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="CAIRO-FONT-TYPE-WIN32:CAPS" role="constant"/><literal>CAIRO_FONT_TYPE_WIN32</literal></term>
<listitem><simpara> The font is of type Win32
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><anchor id="CAIRO-FONT-TYPE-ATSUI:CAPS" role="constant"/><literal>CAIRO_FONT_TYPE_ATSUI</literal></term>
<listitem><simpara> The font is of type ATSUI
</simpara></listitem>
</varlistentry>
</variablelist><para role="since">Since  1.2
</para></refsect2>
<refsect2>
<title><anchor id="cairo-font-face-get-type" role="function" condition="since:1.2"/>cairo_font_face_get_type ()</title>
<indexterm role="1.2"><primary>cairo_font_face_get_type</primary></indexterm><programlisting><link linkend="cairo-font-type-t">cairo_font_type_t</link>   cairo_font_face_get_type            (<link linkend="cairo-font-face-t">cairo_font_face_t</link> *font_face);</programlisting>
<para>
This function returns the type of the backend used to create
a font face. See <link linkend="cairo-font-type-t"><type>cairo_font_type_t</type></link> for available types.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>font_face</parameter>&nbsp;:</term>
<listitem><simpara> a font face
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The type of <parameter>font_face</parameter>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.2
</para></refsect2>
<refsect2>
<title><anchor id="cairo-font-face-get-reference-count" role="function" condition="since:1.4"/>cairo_font_face_get_reference_count ()</title>
<indexterm role="1.4"><primary>cairo_font_face_get_reference_count</primary></indexterm><programlisting>unsigned <link linkend="int">int</link>        cairo_font_face_get_reference_count (<link linkend="cairo-font-face-t">cairo_font_face_t</link> *font_face);</programlisting>
<para>
Returns the current reference count of <parameter>font_face</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>font_face</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the current reference count of <parameter>font_face</parameter>.  If the
object is a nil object, 0 will be returned.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.4
</para></refsect2>
<refsect2>
<title><anchor id="cairo-font-face-set-user-data" role="function"/>cairo_font_face_set_user_data ()</title>
<indexterm><primary>cairo_font_face_set_user_data</primary></indexterm><programlisting><link linkend="cairo-status-t">cairo_status_t</link>      cairo_font_face_set_user_data       (<link linkend="cairo-font-face-t">cairo_font_face_t</link> *font_face,
                                                         const <link linkend="cairo-user-data-key-t">cairo_user_data_key_t</link> *key,
                                                         <link linkend="void">void</link> *user_data,
                                                         <link linkend="cairo-destroy-func-t">cairo_destroy_func_t</link> destroy);</programlisting>
<para>
Attach user data to <parameter>font_face</parameter>.  To remove user data from a font face,
call this function with the key that was used to set it and <link linkend="NULL:CAPS"><literal>NULL</literal></link>
for <parameter>data</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>font_face</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>key</parameter>&nbsp;:</term>
<listitem><simpara> the address of a <link linkend="cairo-user-data-key-t"><type>cairo_user_data_key_t</type></link> to attach the user data to
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
<listitem><simpara> the user data to attach to the font face
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>destroy</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="cairo-destroy-func-t"><type>cairo_destroy_func_t</type></link> which will be called when the
font face is destroyed or when new user data is attached using the
same key.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="CAIRO-STATUS-SUCCESS:CAPS"><literal>CAIRO_STATUS_SUCCESS</literal></link> or <link linkend="CAIRO-STATUS-NO-MEMORY:CAPS"><literal>CAIRO_STATUS_NO_MEMORY</literal></link> if a
slot could not be allocated for the user data.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="cairo-font-face-get-user-data" role="function"/>cairo_font_face_get_user_data ()</title>
<indexterm><primary>cairo_font_face_get_user_data</primary></indexterm><programlisting><link linkend="void">void</link>*               cairo_font_face_get_user_data       (<link linkend="cairo-font-face-t">cairo_font_face_t</link> *font_face,
                                                         const <link linkend="cairo-user-data-key-t">cairo_user_data_key_t</link> *key);</programlisting>
<para>
Return user data previously attached to <parameter>font_face</parameter> using the specified
key.  If no user data has been attached with the given key this
function returns <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>font_face</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>key</parameter>&nbsp;:</term>
<listitem><simpara> the address of the <link linkend="cairo-user-data-key-t"><type>cairo_user_data_key_t</type></link> the user data was
attached to
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the user data previously attached or <link linkend="NULL:CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>





<refsect1><refsect2 /><refsect2 /></refsect1>
</refentry>
