<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="gdk-Fonts">
<refmeta>
<refentrytitle role="top_of_page" id="gdk-Fonts.top_of_page">Fonts</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Fonts</refname>
<refpurpose>Loading and manipulating fonts</refpurpose>
</refnamediv>

<refsynopsisdiv id="gdk-Fonts.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gdk/gdk.h&gt;

                    <link linkend="GdkFont">GdkFont</link>;
enum                <link linkend="GdkFontType">GdkFontType</link>;
<link linkend="GdkFont">GdkFont</link>*            <link linkend="gdk-font-load">gdk_font_load</link>                       (const <link linkend="gchar">gchar</link> *font_name);
<link linkend="GdkFont">GdkFont</link> *           <link linkend="gdk-font-load-for-display">gdk_font_load_for_display</link>           (<link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         const <link linkend="gchar">gchar</link> *font_name);
<link linkend="GdkFont">GdkFont</link>*            <link linkend="gdk-fontset-load">gdk_fontset_load</link>                    (const <link linkend="gchar">gchar</link> *fontset_name);
<link linkend="GdkFont">GdkFont</link> *           <link linkend="gdk-fontset-load-for-display">gdk_fontset_load_for_display</link>        (<link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         const <link linkend="gchar">gchar</link> *fontset_name);
<link linkend="GdkFont">GdkFont</link>*            <link linkend="gdk-font-from-description">gdk_font_from_description</link>           (<link linkend="PangoFontDescription">PangoFontDescription</link> *font_desc);
<link linkend="GdkFont">GdkFont</link> *           <link linkend="gdk-font-from-description-for-display">gdk_font_from_description_for_display</link>
                                                        (<link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         <link linkend="PangoFontDescription">PangoFontDescription</link> *font_desc);
<link linkend="GdkDisplay">GdkDisplay</link> *        <link linkend="gdk-font-get-display">gdk_font_get_display</link>                (<link linkend="GdkFont">GdkFont</link> *font);
<link linkend="GdkFont">GdkFont</link>*            <link linkend="gdk-font-ref">gdk_font_ref</link>                        (<link linkend="GdkFont">GdkFont</link> *font);
<link linkend="void">void</link>                <link linkend="gdk-font-unref">gdk_font_unref</link>                      (<link linkend="GdkFont">GdkFont</link> *font);
<link linkend="gint">gint</link>                <link linkend="gdk-font-id">gdk_font_id</link>                         (const <link linkend="GdkFont">GdkFont</link> *font);
<link linkend="gboolean">gboolean</link>            <link linkend="gdk-font-equal">gdk_font_equal</link>                      (const <link linkend="GdkFont">GdkFont</link> *fonta,
                                                         const <link linkend="GdkFont">GdkFont</link> *fontb);

<link linkend="void">void</link>                <link linkend="gdk-string-extents">gdk_string_extents</link>                  (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *string,
                                                         <link linkend="gint">gint</link> *lbearing,
                                                         <link linkend="gint">gint</link> *rbearing,
                                                         <link linkend="gint">gint</link> *width,
                                                         <link linkend="gint">gint</link> *ascent,
                                                         <link linkend="gint">gint</link> *descent);
<link linkend="void">void</link>                <link linkend="gdk-text-extents">gdk_text_extents</link>                    (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> text_length,
                                                         <link linkend="gint">gint</link> *lbearing,
                                                         <link linkend="gint">gint</link> *rbearing,
                                                         <link linkend="gint">gint</link> *width,
                                                         <link linkend="gint">gint</link> *ascent,
                                                         <link linkend="gint">gint</link> *descent);
<link linkend="void">void</link>                <link linkend="gdk-text-extents-wc">gdk_text_extents_wc</link>                 (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="GdkWChar">GdkWChar</link> *text,
                                                         <link linkend="gint">gint</link> text_length,
                                                         <link linkend="gint">gint</link> *lbearing,
                                                         <link linkend="gint">gint</link> *rbearing,
                                                         <link linkend="gint">gint</link> *width,
                                                         <link linkend="gint">gint</link> *ascent,
                                                         <link linkend="gint">gint</link> *descent);
<link linkend="gint">gint</link>                <link linkend="gdk-string-width">gdk_string_width</link>                    (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *string);
<link linkend="gint">gint</link>                <link linkend="gdk-text-width">gdk_text_width</link>                      (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> text_length);
<link linkend="gint">gint</link>                <link linkend="gdk-text-width-wc">gdk_text_width_wc</link>                   (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="GdkWChar">GdkWChar</link> *text,
                                                         <link linkend="gint">gint</link> text_length);
<link linkend="gint">gint</link>                <link linkend="gdk-char-width">gdk_char_width</link>                      (<link linkend="GdkFont">GdkFont</link> *font,
                                                         <link linkend="gchar">gchar</link> character);
<link linkend="gint">gint</link>                <link linkend="gdk-char-width-wc">gdk_char_width_wc</link>                   (<link linkend="GdkFont">GdkFont</link> *font,
                                                         <link linkend="GdkWChar">GdkWChar</link> character);
<link linkend="gint">gint</link>                <link linkend="gdk-string-measure">gdk_string_measure</link>                  (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *string);
<link linkend="gint">gint</link>                <link linkend="gdk-text-measure">gdk_text_measure</link>                    (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> text_length);
<link linkend="gint">gint</link>                <link linkend="gdk-char-measure">gdk_char_measure</link>                    (<link linkend="GdkFont">GdkFont</link> *font,
                                                         <link linkend="gchar">gchar</link> character);
<link linkend="gint">gint</link>                <link linkend="gdk-string-height">gdk_string_height</link>                   (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *string);
<link linkend="gint">gint</link>                <link linkend="gdk-text-height">gdk_text_height</link>                     (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> text_length);
<link linkend="gint">gint</link>                <link linkend="gdk-char-height">gdk_char_height</link>                     (<link linkend="GdkFont">GdkFont</link> *font,
                                                         <link linkend="gchar">gchar</link> character);

typedef             <link linkend="GdkWChar">GdkWChar</link>;
<link linkend="gchar">gchar</link> *             <link linkend="gdk-wcstombs">gdk_wcstombs</link>                        (const <link linkend="GdkWChar">GdkWChar</link> *src);
<link linkend="gint">gint</link>                <link linkend="gdk-mbstowcs">gdk_mbstowcs</link>                        (<link linkend="GdkWChar">GdkWChar</link> *dest,
                                                         const <link linkend="gchar">gchar</link> *src,
                                                         <link linkend="gint">gint</link> dest_max);
</synopsis>
</refsynopsisdiv>









<refsect1 id="gdk-Fonts.description" role="desc">
<title role="desc.title">Description</title>
<para>
The <link linkend="GdkFont"><type>GdkFont</type></link> data type represents a font for drawing on
the screen. These functions provide support for
loading fonts, and also for determining the dimensions
of characters and strings when drawn with a particular
font.
</para>
<para>
Fonts in X are specified by a
<firstterm>X Logical Font Description</firstterm>.
The following description is considerably simplified.
For definitive information about XLFD's see the
X reference documentation. A X Logical Font Description (XLFD)
consists of a sequence of fields separated (and surrounded by) '-'
characters. For example, Adobe Helvetica Bold 12 pt, has the
full description:
<informalexample><programlisting>
"-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1"
</programlisting></informalexample>
</para>
<para>
The fields in the XLFD are:
<informaltable pgwide="1" frame="none">
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
<tbody>
<row>
<entry>Foundry</entry>
<entry>the company or organization where the font originated.</entry>
</row>
<row>
<entry>Family</entry>
<entry>the font family (a group of related font designs).</entry>
</row>
<row>
<entry>Weight</entry>
<entry>A name for the font's typographic weight
For example, 'bold' or 'medium').</entry>
</row>
<row>
<entry>Slant</entry>
<entry>The slant of the font. Common values are 'R' for Roman,
'I' for italoc, and 'O' for oblique.</entry>
</row>
<row>
<entry>Set Width</entry>
<entry>A name for the width of the font. For example,
'normal' or 'condensed'.</entry>
</row>
<row>
<entry>Add Style</entry>
<entry>Additional information to distinguish a font from
other fonts of the same family.</entry>
</row>
<row>
<entry>Pixel Size</entry>
<entry>The body size of the font in pixels.</entry>
</row>
<row>
<entry>Point Size</entry>
<entry>The body size of the font in 10ths of a point.
(A <firstterm>point</firstterm> is 1/72.27 inch) </entry>
</row>
<row>
<entry>Resolution X</entry>
<entry>The horizontal resolution that the font was designed for.</entry>
</row>
<row>
<entry>Resolution Y</entry>
<entry>The vertical resolution that the font was designed for .</entry>
</row>
<row>
<entry>Spacing</entry>
<entry>The type of spacing for the font - can be 'p' for proportional,
'm' for monospaced or 'c' for charcell.</entry>
</row>
<row>
<entry>Average Width</entry>
<entry>The average width of a glyph in the font. For monospaced
and charcell fonts, all glyphs in the font have this width</entry>
</row>
<row>
<entry>Charset Registry</entry>
<entry>The registration authority that owns the encoding for
the font. Together with the Charset Encoding field, this
defines the character set for the font.</entry>
</row>
<row>
<entry>Charset Encoding</entry>
<entry>An identifier for the particular character set encoding.</entry>
</row>
</tbody></tgroup></informaltable>
</para>
<para>
When specifying a font via a X logical Font Description,
'*' can be used as a wildcard to match any portion of
the XLFD. For instance, the above example could
also be specified as
<informalexample><programlisting>
"-*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1"
</programlisting></informalexample>
It is generally a good idea to use wildcards for any
portion of the XLFD that your program does not care
about specifically, since that will improve the
chances of finding a matching font.
</para>
<para>
A <firstterm>fontset</firstterm> is a list of fonts
that is used for drawing international text that may
contain characters from a number of different character
sets. It is represented by a list of XLFD's.
</para>
<para>
The font for a given character set is determined by going
through the list of XLFD's in order. For each one, if
the registry and and encoding fields match the desired
character set, then that font is used, otherwise if
the XLFD contains wild-cards for the registry and encoding
fields, the registry and encoding for the desired character
set are substituted in and a lookup is done. If a match is found
that font is used. Otherwise, processing continues
on to the next font in the list.
</para>
<para>
The functions for determining the metrics of a string
come in several varieties that can take a number
of forms of string input:
<variablelist>
  <varlistentry>
    <term>8-bit string</term>
    <listitem><para>
    When using functions like <link linkend="gdk-string-width"><function>gdk_string_width()</function></link> that
    take a <type>gchar *</type>, if the font is of type
    <link linkend="GDK-FONT-FONT--CAPS"><literal>GDK_FONT_FONT</literal></link> and is an 8-bit font, then each
    <type>gchar</type> indexes the glyphs in the font directly.
    </para></listitem>
  </varlistentry>
  <varlistentry>
    <term>16-bit string</term>
    <listitem><para>
    For functions taking a <type>gchar *</type>, if the
    font is of type <link linkend="GDK-FONT-FONT--CAPS"><literal>GDK_FONT_FONT</literal></link>, and is a 16-bit
    font, then the <type>gchar *</type> argument is
    interpreted as a <type>guint16 *</type> cast to
    a <type>gchar *</type> and each <type>guint16</type>
    indexes the glyphs in the font directly.
    </para></listitem>
  </varlistentry>
  <varlistentry>
    <term>Multibyte string</term>
    <listitem><para>
    For functions taking a <type>gchar *</type>, if the
    font is of type <link linkend="GDK-FONT-FONTSET--CAPS"><literal>GDK_FONT_FONTSET</literal></link>, then the input
    string is interpreted as a <firstterm>multibyte</firstterm>
    encoded according to the current locale. (A multibyte
    string is one in which each character may consist
    of one or more bytes, with different lengths for different
    characters in the string). They can be converted to and
    from wide character strings (see below) using
    <link linkend="gdk-wcstombs"><function>gdk_wcstombs()</function></link> and <link linkend="gdk-mbstowcs"><function>gdk_mbstowcs()</function></link>.) The string will
    be rendered using one or more different fonts from
    the fontset.
    </para></listitem>
  </varlistentry>
  <varlistentry>
    <term>Wide character string</term>
    <listitem><para>
    For a number of the text-measuring functions, GDK
    provides a variant (such as <link linkend="gdk-text-width-wc"><function>gdk_text_width_wc()</function></link>) which
    takes a <type>GdkWChar *</type> instead of a
    <type>gchar *</type>. The input is then taken to
    be a wide character string in the encoding of the
    current locale. (A wide character string is a string
    in which each character consists of several bytes,
    and the width of each character in the string is
    constant.)
    </para></listitem>
  </varlistentry>
</variablelist>
</para>
<para>
GDK provides functions to determine a number of different
measurements (metrics) for a given string. (Need diagram
here).
<variablelist>
  <varlistentry>
    <term>ascent</term>
    <listitem><para>
    The vertical distance from the origin of the drawing
    opereration to the top of the drawn character.
    </para></listitem>
  </varlistentry>
  <varlistentry>
    <term>descent</term>
    <listitem><para>
    The vertical distance from the origin of the drawing
    opereration to the bottom of the drawn character.
    </para></listitem>
  </varlistentry>
  <varlistentry>
    <term>left bearing</term>
    <listitem><para>
    The horizontal distance from the origin of the drawing
    operation to the left-most part of the drawn character.
    </para></listitem>
  </varlistentry>
  <varlistentry>
    <term>right bearing</term>
    <listitem><para>
    The horizontal distance from the origin of the drawing
    operation to the right-most part of the drawn character.
    </para></listitem>
  </varlistentry>
  <varlistentry>
    <term>width bearing</term>
    <listitem><para>
    The horizontal distance from the origin of the drawing
    operation to the correct origin for drawing another
    string to follow the current one. Depending on the
    font, this could be greater than or less than the
    right bearing.
    </para></listitem>
  </varlistentry>
</variablelist>
</para>
</refsect1>

<refsect1 id="gdk-Fonts.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GdkFont" role="struct" condition="deprecated:">
<title>GdkFont</title>
<indexterm zone="GdkFont" role="deprecated"><primary sortas="Font">GdkFont</primary></indexterm><programlisting>typedef struct {
  GdkFontType type;
  gint ascent;
  gint descent;
} GdkFont;
</programlisting>
<warning><para><literal>GdkFont</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
The <structname>GdkFont</structname> structure represents a font or fontset. It
contains the following public fields. A new <structname>GdkFont</structname>
structure is returned by <link linkend="gdk-font-load"><function>gdk_font_load()</function></link> or <link linkend="gdk-fontset-load"><function>gdk_fontset_load()</function></link>,
and is reference counted with <link linkend="gdk-font-ref"><function>gdk_font_ref()</function></link> and <link linkend="gdk-font-unref"><function>gdk_font_unref()</function></link>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="GdkFontType">GdkFontType</link>&#160;<structfield>type</structfield>;</term>
<listitem><simpara>a value of type <link linkend="GdkFontType"><type>GdkFontType</type></link> which indicates
  whether this font is a single font or a fontset.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gint">gint</link>&#160;<structfield>ascent</structfield>;</term>
<listitem><simpara>the maximum distance that the font, when drawn,
  ascends above the baseline.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gint">gint</link>&#160;<structfield>descent</structfield>;</term>
<listitem><simpara>the maximum distance that the font, when drawn,
descends below the baseline.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GdkFontType" role="enum" condition="deprecated:">
<title>enum GdkFontType</title>
<indexterm zone="GdkFontType" role="deprecated"><primary sortas="FontType">GdkFontType</primary></indexterm><programlisting>typedef enum
{
  GDK_FONT_FONT,
  GDK_FONT_FONTSET
} GdkFontType;
</programlisting>
<warning><para><literal>GdkFontType</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Indicates the type of a font. The possible values
are currently:
</para><variablelist role="enum">
<varlistentry id="GDK-FONT-FONT--CAPS" role="constant">
<term><literal>GDK_FONT_FONT</literal></term>
<listitem><simpara>the font is a single font.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-FONT-FONTSET--CAPS" role="constant">
<term><literal>GDK_FONT_FONTSET</literal></term>
<listitem><simpara>the font is a fontset.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-font-load" role="function" condition="deprecated:">
<title>gdk_font_load ()</title>
<indexterm zone="gdk-font-load" role="deprecated"><primary sortas="font_load">gdk_font_load</primary></indexterm><programlisting><link linkend="GdkFont">GdkFont</link>*            gdk_font_load                       (const <link linkend="gchar">gchar</link> *font_name);</programlisting>
<warning><para><literal>gdk_font_load</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Loads a font.
</para>
<para>
The font may be newly loaded or looked up the font in a cache. 
You should make no assumptions about the initial reference count.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font_name</parameter>&#160;:</term>
<listitem><simpara> a XLFD describing the font to load.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the font could not be loaded.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-font-load-for-display" role="function" condition="deprecated:|since:2.2">
<title>gdk_font_load_for_display ()</title>
<indexterm zone="gdk-font-load-for-display" role="deprecated"><primary sortas="font_load_for_display">gdk_font_load_for_display</primary></indexterm><indexterm zone="gdk-font-load-for-display" role="2.2"><primary sortas="font_load_for_display">gdk_font_load_for_display</primary></indexterm><programlisting><link linkend="GdkFont">GdkFont</link> *           gdk_font_load_for_display           (<link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         const <link linkend="gchar">gchar</link> *font_name);</programlisting>
<warning><para><literal>gdk_font_load_for_display</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Loads a font for use on <parameter>display</parameter>.
</para>
<para>
The font may be newly loaded or looked up the font in a cache. 
You should make no assumptions about the initial reference count.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>display</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkDisplay"><type>GdkDisplay</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>font_name</parameter>&#160;:</term>
<listitem><simpara> a XLFD describing the font to load.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the font could not be loaded.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gdk-fontset-load" role="function" condition="deprecated:">
<title>gdk_fontset_load ()</title>
<indexterm zone="gdk-fontset-load" role="deprecated"><primary sortas="fontset_load">gdk_fontset_load</primary></indexterm><programlisting><link linkend="GdkFont">GdkFont</link>*            gdk_fontset_load                    (const <link linkend="gchar">gchar</link> *fontset_name);</programlisting>
<warning><para><literal>gdk_fontset_load</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Loads a fontset.
</para>
<para>
The fontset may be newly loaded or looked up in a cache. 
You should make no assumptions about the initial reference count.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>fontset_name</parameter>&#160;:</term>
<listitem><simpara> a comma-separated list of XLFDs describing
    the component fonts of the fontset to load.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the fontset could not be loaded.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-fontset-load-for-display" role="function" condition="deprecated:|since:2.2">
<title>gdk_fontset_load_for_display ()</title>
<indexterm zone="gdk-fontset-load-for-display" role="deprecated"><primary sortas="fontset_load_for_display">gdk_fontset_load_for_display</primary></indexterm><indexterm zone="gdk-fontset-load-for-display" role="2.2"><primary sortas="fontset_load_for_display">gdk_fontset_load_for_display</primary></indexterm><programlisting><link linkend="GdkFont">GdkFont</link> *           gdk_fontset_load_for_display        (<link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         const <link linkend="gchar">gchar</link> *fontset_name);</programlisting>
<warning><para><literal>gdk_fontset_load_for_display</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Loads a fontset for use on <parameter>display</parameter>.
</para>
<para>
The fontset may be newly loaded or looked up in a cache. 
You should make no assumptions about the initial reference count.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>display</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkDisplay"><type>GdkDisplay</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>fontset_name</parameter>&#160;:</term>
<listitem><simpara> a comma-separated list of XLFDs describing
  the component fonts of the fontset to load.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the fontset could not be loaded.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gdk-font-from-description" role="function" condition="deprecated:">
<title>gdk_font_from_description ()</title>
<indexterm zone="gdk-font-from-description" role="deprecated"><primary sortas="font_from_description">gdk_font_from_description</primary></indexterm><programlisting><link linkend="GdkFont">GdkFont</link>*            gdk_font_from_description           (<link linkend="PangoFontDescription">PangoFontDescription</link> *font_desc);</programlisting>
<warning><para><literal>gdk_font_from_description</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Load a <link linkend="GdkFont"><type>GdkFont</type></link> based on a Pango font description. This font will
only be an approximation of the Pango font, and
internationalization will not be handled correctly. This function
should only be used for legacy code that cannot be easily converted
to use Pango. Using Pango directly will produce better results.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font_desc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="PangoFontDescription"><type>PangoFontDescription</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the newly loaded font, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the font
cannot be loaded.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-font-from-description-for-display" role="function" condition="deprecated:|since:2.2">
<title>gdk_font_from_description_for_display ()</title>
<indexterm zone="gdk-font-from-description-for-display" role="deprecated"><primary sortas="font_from_description_for_display">gdk_font_from_description_for_display</primary></indexterm><indexterm zone="gdk-font-from-description-for-display" role="2.2"><primary sortas="font_from_description_for_display">gdk_font_from_description_for_display</primary></indexterm><programlisting><link linkend="GdkFont">GdkFont</link> *           gdk_font_from_description_for_display
                                                        (<link linkend="GdkDisplay">GdkDisplay</link> *display,
                                                         <link linkend="PangoFontDescription">PangoFontDescription</link> *font_desc);</programlisting>
<warning><para><literal>gdk_font_from_description_for_display</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Loads a <link linkend="GdkFont"><type>GdkFont</type></link> based on a Pango font description for use on <parameter>display</parameter>. 
This font will only be an approximation of the Pango font, and
internationalization will not be handled correctly. This function
should only be used for legacy code that cannot be easily converted
to use Pango. Using Pango directly will produce better results.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>display</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkDisplay"><type>GdkDisplay</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>font_desc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="PangoFontDescription"><type>PangoFontDescription</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the newly loaded font, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the font
cannot be loaded.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gdk-font-get-display" role="function" condition="deprecated:|since:2.2">
<title>gdk_font_get_display ()</title>
<indexterm zone="gdk-font-get-display" role="deprecated"><primary sortas="font_get_display">gdk_font_get_display</primary></indexterm><indexterm zone="gdk-font-get-display" role="2.2"><primary sortas="font_get_display">gdk_font_get_display</primary></indexterm><programlisting><link linkend="GdkDisplay">GdkDisplay</link> *        gdk_font_get_display                (<link linkend="GdkFont">GdkFont</link> *font);</programlisting>
<warning><para><literal>gdk_font_get_display</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Returns the <link linkend="GdkDisplay"><type>GdkDisplay</type></link> for <parameter>font</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GdkFont"><type>GdkFont</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the corresponding <link linkend="GdkDisplay"><type>GdkDisplay</type></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gdk-font-ref" role="function" condition="deprecated:">
<title>gdk_font_ref ()</title>
<indexterm zone="gdk-font-ref" role="deprecated"><primary sortas="font_ref">gdk_font_ref</primary></indexterm><programlisting><link linkend="GdkFont">GdkFont</link>*            gdk_font_ref                        (<link linkend="GdkFont">GdkFont</link> *font);</programlisting>
<warning><para><literal>gdk_font_ref</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Increases the reference count of a font by one.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <parameter>font</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-font-unref" role="function" condition="deprecated:">
<title>gdk_font_unref ()</title>
<indexterm zone="gdk-font-unref" role="deprecated"><primary sortas="font_unref">gdk_font_unref</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_font_unref                      (<link linkend="GdkFont">GdkFont</link> *font);</programlisting>
<warning><para><literal>gdk_font_unref</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Decreases the reference count of a font by one.
If the result is zero, destroys the font.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-font-id" role="function" condition="deprecated:">
<title>gdk_font_id ()</title>
<indexterm zone="gdk-font-id" role="deprecated"><primary sortas="font_id">gdk_font_id</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_font_id                         (const <link linkend="GdkFont">GdkFont</link> *font);</programlisting>
<warning><para><literal>gdk_font_id</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Returns the X Font ID for the given font.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the numeric X Font ID
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-font-equal" role="function" condition="deprecated:">
<title>gdk_font_equal ()</title>
<indexterm zone="gdk-font-equal" role="deprecated"><primary sortas="font_equal">gdk_font_equal</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gdk_font_equal                      (const <link linkend="GdkFont">GdkFont</link> *fonta,
                                                         const <link linkend="GdkFont">GdkFont</link> *fontb);</programlisting>
<warning><para><literal>gdk_font_equal</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Compares two fonts for equality. Single fonts compare equal
if they have the same X font ID. This operation does
not currently work correctly for fontsets.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>fonta</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>fontb</parameter>&#160;:</term>
<listitem><simpara> another <link linkend="GdkFont"><type>GdkFont</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the fonts are equal.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-string-extents" role="function" condition="deprecated:">
<title>gdk_string_extents ()</title>
<indexterm zone="gdk-string-extents" role="deprecated"><primary sortas="string_extents">gdk_string_extents</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_string_extents                  (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *string,
                                                         <link linkend="gint">gint</link> *lbearing,
                                                         <link linkend="gint">gint</link> *rbearing,
                                                         <link linkend="gint">gint</link> *width,
                                                         <link linkend="gint">gint</link> *ascent,
                                                         <link linkend="gint">gint</link> *descent);</programlisting>
<warning><para><literal>gdk_string_extents</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Gets the metrics of a nul-terminated string.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>string</parameter>&#160;:</term>
<listitem><simpara> the nul-terminated string to measure.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>lbearing</parameter>&#160;:</term>
<listitem><simpara> the left bearing of the string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rbearing</parameter>&#160;:</term>
<listitem><simpara> the right bearing of the string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara> the width of the string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ascent</parameter>&#160;:</term>
<listitem><simpara> the ascent of the string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>descent</parameter>&#160;:</term>
<listitem><simpara> the descent of the string.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-text-extents" role="function" condition="deprecated:">
<title>gdk_text_extents ()</title>
<indexterm zone="gdk-text-extents" role="deprecated"><primary sortas="text_extents">gdk_text_extents</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_text_extents                    (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> text_length,
                                                         <link linkend="gint">gint</link> *lbearing,
                                                         <link linkend="gint">gint</link> *rbearing,
                                                         <link linkend="gint">gint</link> *width,
                                                         <link linkend="gint">gint</link> *ascent,
                                                         <link linkend="gint">gint</link> *descent);</programlisting>
<warning><para><literal>gdk_text_extents</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Gets the metrics of a string.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> the text to measure
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text_length</parameter>&#160;:</term>
<listitem><simpara> the length of the text in bytes. (If the
   font is a 16-bit font, this is twice the length
   of the text in characters.)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>lbearing</parameter>&#160;:</term>
<listitem><simpara> the left bearing of the string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rbearing</parameter>&#160;:</term>
<listitem><simpara> the right bearing of the string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara> the width of the string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ascent</parameter>&#160;:</term>
<listitem><simpara> the ascent of the string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>descent</parameter>&#160;:</term>
<listitem><simpara> the descent of the string.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-text-extents-wc" role="function" condition="deprecated:">
<title>gdk_text_extents_wc ()</title>
<indexterm zone="gdk-text-extents-wc" role="deprecated"><primary sortas="text_extents_wc">gdk_text_extents_wc</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_text_extents_wc                 (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="GdkWChar">GdkWChar</link> *text,
                                                         <link linkend="gint">gint</link> text_length,
                                                         <link linkend="gint">gint</link> *lbearing,
                                                         <link linkend="gint">gint</link> *rbearing,
                                                         <link linkend="gint">gint</link> *width,
                                                         <link linkend="gint">gint</link> *ascent,
                                                         <link linkend="gint">gint</link> *descent);</programlisting>
<warning><para><literal>gdk_text_extents_wc</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Gets the metrics of a string of wide characters.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> the text to measure.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text_length</parameter>&#160;:</term>
<listitem><simpara> the length of the text in character.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>lbearing</parameter>&#160;:</term>
<listitem><simpara> the left bearing of the string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rbearing</parameter>&#160;:</term>
<listitem><simpara> the right bearing of the string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara> the width of the string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ascent</parameter>&#160;:</term>
<listitem><simpara> the ascent of the string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>descent</parameter>&#160;:</term>
<listitem><simpara> the descent of the string.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-string-width" role="function" condition="deprecated:">
<title>gdk_string_width ()</title>
<indexterm zone="gdk-string-width" role="deprecated"><primary sortas="string_width">gdk_string_width</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_string_width                    (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *string);</programlisting>
<warning><para><literal>gdk_string_width</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Determines the width of a nul-terminated string.
(The distance from the origin of the string to the 
point where the next string in a sequence of strings
should be drawn)</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara>  a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>string</parameter>&#160;:</term>
<listitem><simpara> the nul-terminated string to measure
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the width of the string in pixels.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-text-width" role="function" condition="deprecated:">
<title>gdk_text_width ()</title>
<indexterm zone="gdk-text-width" role="deprecated"><primary sortas="text_width">gdk_text_width</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_text_width                      (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> text_length);</programlisting>
<warning><para><literal>gdk_text_width</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Determines the width of a given string.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> the text to measure.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text_length</parameter>&#160;:</term>
<listitem><simpara> the length of the text in bytes.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the width of the string in pixels.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-text-width-wc" role="function" condition="deprecated:">
<title>gdk_text_width_wc ()</title>
<indexterm zone="gdk-text-width-wc" role="deprecated"><primary sortas="text_width_wc">gdk_text_width_wc</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_text_width_wc                   (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="GdkWChar">GdkWChar</link> *text,
                                                         <link linkend="gint">gint</link> text_length);</programlisting>
<warning><para><literal>gdk_text_width_wc</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Determines the width of a given wide-character string.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> the text to measure.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text_length</parameter>&#160;:</term>
<listitem><simpara> the length of the text in characters.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the width of the string in pixels.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-char-width" role="function" condition="deprecated:Use gdk_text_extents() instead.">
<title>gdk_char_width ()</title>
<indexterm zone="gdk-char-width" role="deprecated"><primary sortas="char_width">gdk_char_width</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_char_width                      (<link linkend="GdkFont">GdkFont</link> *font,
                                                         <link linkend="gchar">gchar</link> character);</programlisting>
<warning><para><literal>gdk_char_width</literal> is deprecated and should not be used in newly-written code. Use <link linkend="gdk-text-extents"><function>gdk_text_extents()</function></link> instead.</para></warning>
<para>
Determines the width of a given character.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>character</parameter>&#160;:</term>
<listitem><simpara> the character to measure.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the width of the character in pixels.

</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-char-width-wc" role="function" condition="deprecated:">
<title>gdk_char_width_wc ()</title>
<indexterm zone="gdk-char-width-wc" role="deprecated"><primary sortas="char_width_wc">gdk_char_width_wc</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_char_width_wc                   (<link linkend="GdkFont">GdkFont</link> *font,
                                                         <link linkend="GdkWChar">GdkWChar</link> character);</programlisting>
<warning><para><literal>gdk_char_width_wc</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Determines the width of a given wide character. (Encoded
in the wide-character encoding of the current locale).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>character</parameter>&#160;:</term>
<listitem><simpara> the character to measure.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the width of the character in pixels.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-string-measure" role="function" condition="deprecated:">
<title>gdk_string_measure ()</title>
<indexterm zone="gdk-string-measure" role="deprecated"><primary sortas="string_measure">gdk_string_measure</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_string_measure                  (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *string);</programlisting>
<warning><para><literal>gdk_string_measure</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Determines the distance from the origin to the rightmost
portion of a nul-terminated string when drawn. This is not the
correct value for determining the origin of the next
portion when drawing text in multiple pieces.
See <link linkend="gdk-string-width"><function>gdk_string_width()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>string</parameter>&#160;:</term>
<listitem><simpara> the nul-terminated string to measure.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the right bearing of the string in pixels.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-text-measure" role="function" condition="deprecated:">
<title>gdk_text_measure ()</title>
<indexterm zone="gdk-text-measure" role="deprecated"><primary sortas="text_measure">gdk_text_measure</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_text_measure                    (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> text_length);</programlisting>
<warning><para><literal>gdk_text_measure</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Determines the distance from the origin to the rightmost
portion of a string when drawn. This is not the
correct value for determining the origin of the next
portion when drawing text in multiple pieces. 
See <link linkend="gdk-text-width"><function>gdk_text_width()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> the text to measure.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text_length</parameter>&#160;:</term>
<listitem><simpara> the length of the text in bytes.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the right bearing of the string in pixels.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-char-measure" role="function" condition="deprecated:">
<title>gdk_char_measure ()</title>
<indexterm zone="gdk-char-measure" role="deprecated"><primary sortas="char_measure">gdk_char_measure</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_char_measure                    (<link linkend="GdkFont">GdkFont</link> *font,
                                                         <link linkend="gchar">gchar</link> character);</programlisting>
<warning><para><literal>gdk_char_measure</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Determines the distance from the origin to the rightmost
portion of a character when drawn. This is not the
correct value for determining the origin of the next
portion when drawing text in multiple pieces.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>character</parameter>&#160;:</term>
<listitem><simpara> the character to measure.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the right bearing of the character in pixels.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-string-height" role="function" condition="deprecated:">
<title>gdk_string_height ()</title>
<indexterm zone="gdk-string-height" role="deprecated"><primary sortas="string_height">gdk_string_height</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_string_height                   (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *string);</programlisting>
<warning><para><literal>gdk_string_height</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Determines the total height of a given nul-terminated
string. This value is not generally useful, because you
cannot determine how this total height will be drawn in
relation to the baseline. See <link linkend="gdk-string-extents"><function>gdk_string_extents()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>string</parameter>&#160;:</term>
<listitem><simpara> the nul-terminated string to measure.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the height of the string in pixels.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-text-height" role="function" condition="deprecated:">
<title>gdk_text_height ()</title>
<indexterm zone="gdk-text-height" role="deprecated"><primary sortas="text_height">gdk_text_height</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_text_height                     (<link linkend="GdkFont">GdkFont</link> *font,
                                                         const <link linkend="gchar">gchar</link> *text,
                                                         <link linkend="gint">gint</link> text_length);</programlisting>
<warning><para><literal>gdk_text_height</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Determines the total height of a given string.
This value is not generally useful, because you cannot
determine how this total height will be drawn in
relation to the baseline. See <link linkend="gdk-text-extents"><function>gdk_text_extents()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> the text to measure.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text_length</parameter>&#160;:</term>
<listitem><simpara> the length of the text in bytes.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the height of the string in pixels.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-char-height" role="function" condition="deprecated:Use gdk_text_extents() instead.">
<title>gdk_char_height ()</title>
<indexterm zone="gdk-char-height" role="deprecated"><primary sortas="char_height">gdk_char_height</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_char_height                     (<link linkend="GdkFont">GdkFont</link> *font,
                                                         <link linkend="gchar">gchar</link> character);</programlisting>
<warning><para><literal>gdk_char_height</literal> is deprecated and should not be used in newly-written code. Use <link linkend="gdk-text-extents"><function>gdk_text_extents()</function></link> instead.</para></warning>
<para>
Determines the total height of a given character.
This value is not generally useful, because you cannot
determine how this total height will be drawn in
relation to the baseline. See <link linkend="gdk-text-extents"><function>gdk_text_extents()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>font</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>character</parameter>&#160;:</term>
<listitem><simpara> the character to measure.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the height of the character in pixels.

</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GdkWChar" role="typedef">
<title>GdkWChar</title>
<indexterm zone="GdkWChar"><primary sortas="WChar">GdkWChar</primary></indexterm><programlisting>typedef guint32			    GdkWChar;
</programlisting>
<para>
Specifies a wide character type, used to represent character codes.
This is needed since some native languages have character sets which have
more than 256 characters (Japanese and Chinese, for example).
</para>
<para>
Wide character values between 0 and 127 are always identical in meaning to
the ASCII character codes. The wide character value 0 is often used to
terminate strings of wide characters in a similar way to normal strings
using the char type.
</para>
<para>
An alternative to wide characters is multi-byte characters, which extend
normal char strings to cope with larger character sets. As the name suggests,
multi-byte characters use a different number of bytes to store different
character codes. For example codes 0-127 (i.e. the ASCII codes) often
use just one byte of memory, while other codes may use 2, 3 or even 4 bytes.
Multi-byte characters have the advantage that they can often be used in an
application with little change, since strings are still represented as arrays
of char values. However multi-byte strings are much easier to manipulate since
the character are all of the same size.
</para>
<para>
Applications typically use wide characters to represent character codes
internally, and multi-byte strings when saving the characters to a file.
The <link linkend="gdk-wcstombs"><function>gdk_wcstombs()</function></link> and <link linkend="gdk-mbstowcs"><function>gdk_mbstowcs()</function></link> functions can be used to convert from
one representation to the other.
</para>
<para>
See the 'Extended Characters' section of the GNU C Library Reference Manual
for more detailed information on wide and multi-byte characters.
</para></refsect2>
<refsect2 id="gdk-wcstombs" role="function" condition="deprecated:">
<title>gdk_wcstombs ()</title>
<indexterm zone="gdk-wcstombs" role="deprecated"><primary sortas="wcstombs">gdk_wcstombs</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             gdk_wcstombs                        (const <link linkend="GdkWChar">GdkWChar</link> *src);</programlisting>
<warning><para><literal>gdk_wcstombs</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Converts a wide character string to a multi-byte string.
(The function name comes from an acronym of 'Wide Character String TO
Multi-Byte String').</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>src</parameter>&#160;:</term>
<listitem><simpara> a wide character string.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the multi-byte string corresponding to <parameter>src</parameter>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the
conversion failed. The returned string should be freed with <link linkend="g-free"><function>g_free()</function></link> when no
longer needed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-mbstowcs" role="function" condition="deprecated:">
<title>gdk_mbstowcs ()</title>
<indexterm zone="gdk-mbstowcs" role="deprecated"><primary sortas="mbstowcs">gdk_mbstowcs</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_mbstowcs                        (<link linkend="GdkWChar">GdkWChar</link> *dest,
                                                         const <link linkend="gchar">gchar</link> *src,
                                                         <link linkend="gint">gint</link> dest_max);</programlisting>
<warning><para><literal>gdk_mbstowcs</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Converts a multi-byte string to a wide character string.
(The function name comes from an acronym of 'Multi-Byte String TO Wide
Character String').</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>dest</parameter>&#160;:</term>
<listitem><simpara> the space to place the converted wide character string into.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>src</parameter>&#160;:</term>
<listitem><simpara> the multi-byte string to convert, which must be nul-terminated.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dest_max</parameter>&#160;:</term>
<listitem><simpara> the maximum number of wide characters to place in <parameter>dest</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the number of wide characters written into <parameter>dest</parameter>, or -1 if 
  the conversion failed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
