<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Fonts: GDK 2 Reference Manual</title> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> <link rel="home" href="index.html" title="GDK 2 Reference Manual"> <link rel="up" href="reference.html" title="API Reference"> <link rel="prev" href="gdk2-Visuals.html" title="Visuals"> <link rel="next" href="gdk2-Cursors.html" title="Cursors"> <meta name="generator" content="GTK-Doc V1.24.1 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> <td width="100%" align="left" class="shortcuts"> <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> <a href="#gdk2-Fonts.description" class="shortcut">Description</a></span> </td> <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> <td><a accesskey="u" href="reference.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> <td><a accesskey="p" href="gdk2-Visuals.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> <td><a accesskey="n" href="gdk2-Cursors.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> </tr></table> <div class="refentry"> <a name="gdk2-Fonts"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2><span class="refentrytitle"><a name="gdk2-Fonts.top_of_page"></a>Fonts</span></h2> <p>Fonts — Loading and manipulating fonts</p> </td> <td class="gallery_image" valign="top" align="right"></td> </tr></table></div> <div class="refsect1"> <a name="gdk2-Fonts.functions"></a><h2>Functions</h2> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="functions_return"> <col class="functions_name"> </colgroup> <tbody> <tr> <td class="function_type"> <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="returnvalue">GdkFont</span></a> * </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-font-load" title="gdk_font_load ()">gdk_font_load</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="returnvalue">GdkFont</span></a> * </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-font-load-for-display" title="gdk_font_load_for_display ()">gdk_font_load_for_display</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="returnvalue">GdkFont</span></a> * </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-fontset-load" title="gdk_fontset_load ()">gdk_fontset_load</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="returnvalue">GdkFont</span></a> * </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-fontset-load-for-display" title="gdk_fontset_load_for_display ()">gdk_fontset_load_for_display</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="returnvalue">GdkFont</span></a> * </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-font-from-description" title="gdk_font_from_description ()">gdk_font_from_description</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="returnvalue">GdkFont</span></a> * </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-font-from-description-for-display" title="gdk_font_from_description_for_display ()">gdk_font_from_description_for_display</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="returnvalue">GdkDisplay</span></a> * </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-font-get-display" title="gdk_font_get_display ()">gdk_font_get_display</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="returnvalue">GdkFont</span></a> * </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-font-ref" title="gdk_font_ref ()">gdk_font_ref</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-font-unref" title="gdk_font_unref ()">gdk_font_unref</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-font-id" title="gdk_font_id ()">gdk_font_id</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-font-equal" title="gdk_font_equal ()">gdk_font_equal</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-string-extents" title="gdk_string_extents ()">gdk_string_extents</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-text-extents" title="gdk_text_extents ()">gdk_text_extents</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-text-extents-wc" title="gdk_text_extents_wc ()">gdk_text_extents_wc</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-string-width" title="gdk_string_width ()">gdk_string_width</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-text-width" title="gdk_text_width ()">gdk_text_width</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-text-width-wc" title="gdk_text_width_wc ()">gdk_text_width_wc</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-char-width" title="gdk_char_width ()">gdk_char_width</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-char-width-wc" title="gdk_char_width_wc ()">gdk_char_width_wc</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-string-measure" title="gdk_string_measure ()">gdk_string_measure</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-text-measure" title="gdk_text_measure ()">gdk_text_measure</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-char-measure" title="gdk_char_measure ()">gdk_char_measure</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-string-height" title="gdk_string_height ()">gdk_string_height</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-text-height" title="gdk_text_height ()">gdk_text_height</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-char-height" title="gdk_char_height ()">gdk_char_height</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-wcstombs" title="gdk_wcstombs ()">gdk_wcstombs</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> </td> <td class="function_name"> <a class="link" href="gdk2-Fonts.html#gdk-mbstowcs" title="gdk_mbstowcs ()">gdk_mbstowcs</a> <span class="c_punctuation">()</span> </td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="gdk2-Fonts.other"></a><h2>Types and Values</h2> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="name"> <col class="description"> </colgroup> <tbody> <tr> <td class="datatype_keyword"> </td> <td class="function_name"><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont">GdkFont</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="gdk2-Fonts.html#GdkFontType" title="enum GdkFontType">GdkFontType</a></td> </tr> <tr> <td class="typedef_keyword">typedef</td> <td class="function_name"><a class="link" href="gdk2-Fonts.html#GdkWChar" title="GdkWChar">GdkWChar</a></td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="gdk2-Fonts.includes"></a><h2>Includes</h2> <pre class="synopsis">#include <gdk/gdk.h> </pre> </div> <div class="refsect1"> <a name="gdk2-Fonts.description"></a><h2>Description</h2> <p> The <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> 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. </p> <p> Fonts in X are specified by a <em class="firstterm">X Logical Font Description</em>. 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: </p> <div class="informalexample"> <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="listing_lines" align="right"><pre>1</pre></td> <td class="listing_code"><pre class="programlisting"><span class="string">"-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1"</span></pre></td> </tr> </tbody> </table> </div> <p> </p> <p> The fields in the XLFD are: </p> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col> <col> </colgroup> <tbody> <tr> <td>Foundry</td> <td>the company or organization where the font originated.</td> </tr> <tr> <td>Family</td> <td>the font family (a group of related font designs).</td> </tr> <tr> <td>Weight</td> <td>A name for the font's typographic weight For example, 'bold' or 'medium').</td> </tr> <tr> <td>Slant</td> <td>The slant of the font. Common values are 'R' for Roman, 'I' for italoc, and 'O' for oblique.</td> </tr> <tr> <td>Set Width</td> <td>A name for the width of the font. For example, 'normal' or 'condensed'.</td> </tr> <tr> <td>Add Style</td> <td>Additional information to distinguish a font from other fonts of the same family.</td> </tr> <tr> <td>Pixel Size</td> <td>The body size of the font in pixels.</td> </tr> <tr> <td>Point Size</td> <td>The body size of the font in 10ths of a point. (A <em class="firstterm">point</em> is 1/72.27 inch) </td> </tr> <tr> <td>Resolution X</td> <td>The horizontal resolution that the font was designed for.</td> </tr> <tr> <td>Resolution Y</td> <td>The vertical resolution that the font was designed for .</td> </tr> <tr> <td>Spacing</td> <td>The type of spacing for the font - can be 'p' for proportional, 'm' for monospaced or 'c' for charcell.</td> </tr> <tr> <td>Average Width</td> <td>The average width of a glyph in the font. For monospaced and charcell fonts, all glyphs in the font have this width</td> </tr> <tr> <td>Charset Registry</td> <td>The registration authority that owns the encoding for the font. Together with the Charset Encoding field, this defines the character set for the font.</td> </tr> <tr> <td>Charset Encoding</td> <td>An identifier for the particular character set encoding.</td> </tr> </tbody> </table></div> <p> </p> <p> 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 </p> <div class="informalexample"> <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="listing_lines" align="right"><pre>1</pre></td> <td class="listing_code"><pre class="programlisting"><span class="string">"-*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1"</span></pre></td> </tr> </tbody> </table> </div> <p> 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. </p> <p> A <em class="firstterm">fontset</em> 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. </p> <p> 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. </p> <p> The functions for determining the metrics of a string come in several varieties that can take a number of forms of string input: </p> <div class="variablelist"><table border="0" class="variablelist"> <colgroup> <col align="left" valign="top"> <col> </colgroup> <tbody> <tr> <td><p><span class="term">8-bit string</span></p></td> <td><p> When using functions like <a class="link" href="gdk2-Fonts.html#gdk-string-width" title="gdk_string_width ()"><code class="function">gdk_string_width()</code></a> that take a <span class="type">gchar *</span>, if the font is of type <a class="link" href="gdk2-Fonts.html#GDK-FONT-FONT:CAPS"><code class="literal">GDK_FONT_FONT</code></a> and is an 8-bit font, then each <span class="type">gchar</span> indexes the glyphs in the font directly. </p></td> </tr> <tr> <td><p><span class="term">16-bit string</span></p></td> <td><p> For functions taking a <span class="type">gchar *</span>, if the font is of type <a class="link" href="gdk2-Fonts.html#GDK-FONT-FONT:CAPS"><code class="literal">GDK_FONT_FONT</code></a>, and is a 16-bit font, then the <span class="type">gchar *</span> argument is interpreted as a <span class="type">guint16 *</span> cast to a <span class="type">gchar *</span> and each <span class="type">guint16</span> indexes the glyphs in the font directly. </p></td> </tr> <tr> <td><p><span class="term">Multibyte string</span></p></td> <td><p> For functions taking a <span class="type">gchar *</span>, if the font is of type <a class="link" href="gdk2-Fonts.html#GDK-FONT-FONTSET:CAPS"><code class="literal">GDK_FONT_FONTSET</code></a>, then the input string is interpreted as a <em class="firstterm">multibyte</em> 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 <a class="link" href="gdk2-Fonts.html#gdk-wcstombs" title="gdk_wcstombs ()"><code class="function">gdk_wcstombs()</code></a> and <a class="link" href="gdk2-Fonts.html#gdk-mbstowcs" title="gdk_mbstowcs ()"><code class="function">gdk_mbstowcs()</code></a>.) The string will be rendered using one or more different fonts from the fontset. </p></td> </tr> <tr> <td><p><span class="term">Wide character string</span></p></td> <td><p> For a number of the text-measuring functions, GDK provides a variant (such as <a class="link" href="gdk2-Fonts.html#gdk-text-width-wc" title="gdk_text_width_wc ()"><code class="function">gdk_text_width_wc()</code></a>) which takes a <span class="type">GdkWChar *</span> instead of a <span class="type">gchar *</span>. 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.) </p></td> </tr> </tbody> </table></div> <p> </p> <p> GDK provides functions to determine a number of different measurements (metrics) for a given string. (Need diagram here). </p> <div class="variablelist"><table border="0" class="variablelist"> <colgroup> <col align="left" valign="top"> <col> </colgroup> <tbody> <tr> <td><p><span class="term">ascent</span></p></td> <td><p> The vertical distance from the origin of the drawing opereration to the top of the drawn character. </p></td> </tr> <tr> <td><p><span class="term">descent</span></p></td> <td><p> The vertical distance from the origin of the drawing opereration to the bottom of the drawn character. </p></td> </tr> <tr> <td><p><span class="term">left bearing</span></p></td> <td><p> The horizontal distance from the origin of the drawing operation to the left-most part of the drawn character. </p></td> </tr> <tr> <td><p><span class="term">right bearing</span></p></td> <td><p> The horizontal distance from the origin of the drawing operation to the right-most part of the drawn character. </p></td> </tr> <tr> <td><p><span class="term">width bearing</span></p></td> <td><p> 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. </p></td> </tr> </tbody> </table></div> <p> </p> </div> <div class="refsect1"> <a name="gdk2-Fonts.functions_details"></a><h2>Functions</h2> <div class="refsect2"> <a name="gdk-font-load"></a><h3>gdk_font_load ()</h3> <pre class="programlisting"><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="returnvalue">GdkFont</span></a> * gdk_font_load (<em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *font_name</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_font_load</code> is deprecated and should not be used in newly-written code.</p></div> <p>Loads a font.</p> <p>The font may be newly loaded or looked up the font in a cache. You should make no assumptions about the initial reference count.</p> <div class="refsect3"> <a name="gdk-font-load.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>font_name</p></td> <td class="parameter_description"><p>a XLFD describing the font to load.</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-font-load.returns"></a><h4>Returns</h4> <p> a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a>, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the font could not be loaded.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-font-load-for-display"></a><h3>gdk_font_load_for_display ()</h3> <pre class="programlisting"><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="returnvalue">GdkFont</span></a> * gdk_font_load_for_display (<em class="parameter"><code><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> *display</code></em>, <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *font_name</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_font_load_for_display</code> is deprecated and should not be used in newly-written code.</p></div> <p>Loads a font for use on <em class="parameter"><code>display</code></em> .</p> <p>The font may be newly loaded or looked up the font in a cache. You should make no assumptions about the initial reference count.</p> <div class="refsect3"> <a name="gdk-font-load-for-display.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>display</p></td> <td class="parameter_description"><p>a <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>font_name</p></td> <td class="parameter_description"><p>a XLFD describing the font to load.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-font-load-for-display.returns"></a><h4>Returns</h4> <p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a>, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the font could not be loaded.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p> </div> <hr> <div class="refsect2"> <a name="gdk-fontset-load"></a><h3>gdk_fontset_load ()</h3> <pre class="programlisting"><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="returnvalue">GdkFont</span></a> * gdk_fontset_load (<em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *fontset_name</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_fontset_load</code> is deprecated and should not be used in newly-written code.</p></div> <p>Loads a fontset.</p> <p>The fontset may be newly loaded or looked up in a cache. You should make no assumptions about the initial reference count.</p> <div class="refsect3"> <a name="gdk-fontset-load.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>fontset_name</p></td> <td class="parameter_description"><p>a comma-separated list of XLFDs describing the component fonts of the fontset to load.</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-fontset-load.returns"></a><h4>Returns</h4> <p> a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a>, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the fontset could not be loaded.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-fontset-load-for-display"></a><h3>gdk_fontset_load_for_display ()</h3> <pre class="programlisting"><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="returnvalue">GdkFont</span></a> * gdk_fontset_load_for_display (<em class="parameter"><code><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> *display</code></em>, <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *fontset_name</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_fontset_load_for_display</code> is deprecated and should not be used in newly-written code.</p></div> <p>Loads a fontset for use on <em class="parameter"><code>display</code></em> .</p> <p>The fontset may be newly loaded or looked up in a cache. You should make no assumptions about the initial reference count.</p> <div class="refsect3"> <a name="gdk-fontset-load-for-display.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>display</p></td> <td class="parameter_description"><p>a <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>fontset_name</p></td> <td class="parameter_description"><p>a comma-separated list of XLFDs describing the component fonts of the fontset to load.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-fontset-load-for-display.returns"></a><h4>Returns</h4> <p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a>, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the fontset could not be loaded.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p> </div> <hr> <div class="refsect2"> <a name="gdk-font-from-description"></a><h3>gdk_font_from_description ()</h3> <pre class="programlisting"><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="returnvalue">GdkFont</span></a> * gdk_font_from_description (<em class="parameter"><code><a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Fonts.html#PangoFontDescription-struct"><span class="type">PangoFontDescription</span></a> *font_desc</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_font_from_description</code> is deprecated and should not be used in newly-written code.</p></div> <p>Load a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> 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.</p> <div class="refsect3"> <a name="gdk-font-from-description.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>font_desc</p></td> <td class="parameter_description"><p>a <a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Fonts.html#PangoFontDescription-struct"><span class="type">PangoFontDescription</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-font-from-description.returns"></a><h4>Returns</h4> <p> the newly loaded font, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the font cannot be loaded.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-font-from-description-for-display"></a><h3>gdk_font_from_description_for_display ()</h3> <pre class="programlisting"><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="returnvalue">GdkFont</span></a> * gdk_font_from_description_for_display (<em class="parameter"><code><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> *display</code></em>, <em class="parameter"><code><a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Fonts.html#PangoFontDescription-struct"><span class="type">PangoFontDescription</span></a> *font_desc</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_font_from_description_for_display</code> is deprecated and should not be used in newly-written code.</p></div> <p>Loads a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> based on a Pango font description for use on <em class="parameter"><code>display</code></em> . 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.</p> <div class="refsect3"> <a name="gdk-font-from-description-for-display.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>display</p></td> <td class="parameter_description"><p>a <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>font_desc</p></td> <td class="parameter_description"><p>a <a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Fonts.html#PangoFontDescription-struct"><span class="type">PangoFontDescription</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-font-from-description-for-display.returns"></a><h4>Returns</h4> <p> the newly loaded font, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the font cannot be loaded.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p> </div> <hr> <div class="refsect2"> <a name="gdk-font-get-display"></a><h3>gdk_font_get_display ()</h3> <pre class="programlisting"><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="returnvalue">GdkDisplay</span></a> * gdk_font_get_display (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_font_get_display</code> is deprecated and should not be used in newly-written code.</p></div> <p>Returns the <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> for <em class="parameter"><code>font</code></em> .</p> <div class="refsect3"> <a name="gdk-font-get-display.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>the <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-font-get-display.returns"></a><h4>Returns</h4> <p> the corresponding <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a>.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p> </div> <hr> <div class="refsect2"> <a name="gdk-font-ref"></a><h3>gdk_font_ref ()</h3> <pre class="programlisting"><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="returnvalue">GdkFont</span></a> * gdk_font_ref (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_font_ref</code> is deprecated and should not be used in newly-written code.</p></div> <p>Increases the reference count of a font by one.</p> <div class="refsect3"> <a name="gdk-font-ref.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-font-ref.returns"></a><h4>Returns</h4> <p> <em class="parameter"><code>font</code></em> </p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-font-unref"></a><h3>gdk_font_unref ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> gdk_font_unref (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_font_unref</code> is deprecated and should not be used in newly-written code.</p></div> <p>Decreases the reference count of a font by one. If the result is zero, destroys the font.</p> <div class="refsect3"> <a name="gdk-font-unref.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="gdk-font-id"></a><h3>gdk_font_id ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gdk_font_id (<em class="parameter"><code>const <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_font_id</code> is deprecated and should not be used in newly-written code.</p></div> <p>Returns the X Font ID for the given font.</p> <div class="refsect3"> <a name="gdk-font-id.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-font-id.returns"></a><h4>Returns</h4> <p> the numeric X Font ID</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-font-equal"></a><h3>gdk_font_equal ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gdk_font_equal (<em class="parameter"><code>const <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *fonta</code></em>, <em class="parameter"><code>const <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *fontb</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_font_equal</code> is deprecated and should not be used in newly-written code.</p></div> <p>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.</p> <div class="refsect3"> <a name="gdk-font-equal.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>fonta</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>fontb</p></td> <td class="parameter_description"><p>another <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-font-equal.returns"></a><h4>Returns</h4> <p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the fonts are equal.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-string-extents"></a><h3>gdk_string_extents ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> gdk_string_extents (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>, <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *lbearing</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *rbearing</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *width</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *ascent</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *descent</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_string_extents</code> is deprecated and should not be used in newly-written code.</p></div> <p>Gets the metrics of a nul-terminated string.</p> <div class="refsect3"> <a name="gdk-string-extents.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>string</p></td> <td class="parameter_description"><p>the nul-terminated string to measure.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>lbearing</p></td> <td class="parameter_description"><p>the left bearing of the string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>rbearing</p></td> <td class="parameter_description"><p>the right bearing of the string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>width</p></td> <td class="parameter_description"><p>the width of the string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>ascent</p></td> <td class="parameter_description"><p>the ascent of the string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>descent</p></td> <td class="parameter_description"><p>the descent of the string.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="gdk-text-extents"></a><h3>gdk_text_extents ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> gdk_text_extents (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>, <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> text_length</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *lbearing</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *rbearing</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *width</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *ascent</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *descent</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_text_extents</code> is deprecated and should not be used in newly-written code.</p></div> <p>Gets the metrics of a string.</p> <div class="refsect3"> <a name="gdk-text-extents.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>text</p></td> <td class="parameter_description"><p>the text to measure</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>text_length</p></td> <td class="parameter_description"><p>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.)</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>lbearing</p></td> <td class="parameter_description"><p>the left bearing of the string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>rbearing</p></td> <td class="parameter_description"><p>the right bearing of the string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>width</p></td> <td class="parameter_description"><p>the width of the string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>ascent</p></td> <td class="parameter_description"><p>the ascent of the string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>descent</p></td> <td class="parameter_description"><p>the descent of the string.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="gdk-text-extents-wc"></a><h3>gdk_text_extents_wc ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> gdk_text_extents_wc (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>, <em class="parameter"><code>const <a class="link" href="gdk2-Fonts.html#GdkWChar" title="GdkWChar"><span class="type">GdkWChar</span></a> *text</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> text_length</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *lbearing</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *rbearing</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *width</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *ascent</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *descent</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_text_extents_wc</code> is deprecated and should not be used in newly-written code.</p></div> <p>Gets the metrics of a string of wide characters.</p> <div class="refsect3"> <a name="gdk-text-extents-wc.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>text</p></td> <td class="parameter_description"><p>the text to measure.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>text_length</p></td> <td class="parameter_description"><p>the length of the text in character.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>lbearing</p></td> <td class="parameter_description"><p>the left bearing of the string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>rbearing</p></td> <td class="parameter_description"><p>the right bearing of the string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>width</p></td> <td class="parameter_description"><p>the width of the string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>ascent</p></td> <td class="parameter_description"><p>the ascent of the string.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>descent</p></td> <td class="parameter_description"><p>the descent of the string.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="gdk-string-width"></a><h3>gdk_string_width ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gdk_string_width (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>, <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_string_width</code> is deprecated and should not be used in newly-written code.</p></div> <p>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)</p> <div class="refsect3"> <a name="gdk-string-width.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>string</p></td> <td class="parameter_description"><p>the nul-terminated string to measure</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-string-width.returns"></a><h4>Returns</h4> <p> the width of the string in pixels.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-text-width"></a><h3>gdk_text_width ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gdk_text_width (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>, <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> text_length</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_text_width</code> is deprecated and should not be used in newly-written code.</p></div> <p>Determines the width of a given string.</p> <div class="refsect3"> <a name="gdk-text-width.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>text</p></td> <td class="parameter_description"><p>the text to measure.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>text_length</p></td> <td class="parameter_description"><p>the length of the text in bytes.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-text-width.returns"></a><h4>Returns</h4> <p> the width of the string in pixels.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-text-width-wc"></a><h3>gdk_text_width_wc ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gdk_text_width_wc (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>, <em class="parameter"><code>const <a class="link" href="gdk2-Fonts.html#GdkWChar" title="GdkWChar"><span class="type">GdkWChar</span></a> *text</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> text_length</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_text_width_wc</code> is deprecated and should not be used in newly-written code.</p></div> <p>Determines the width of a given wide-character string.</p> <div class="refsect3"> <a name="gdk-text-width-wc.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>text</p></td> <td class="parameter_description"><p>the text to measure.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>text_length</p></td> <td class="parameter_description"><p>the length of the text in characters.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-text-width-wc.returns"></a><h4>Returns</h4> <p> the width of the string in pixels.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-char-width"></a><h3>gdk_char_width ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gdk_char_width (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> character</code></em>);</pre> <div class="warning"> <p><code class="literal">gdk_char_width</code> has been deprecated since version 2.2 and should not be used in newly-written code.</p> <p>Use <a class="link" href="gdk2-Fonts.html#gdk-text-extents" title="gdk_text_extents ()"><code class="function">gdk_text_extents()</code></a> instead.</p> </div> <p>Determines the width of a given character.</p> <div class="refsect3"> <a name="gdk-char-width.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>character</p></td> <td class="parameter_description"><p>the character to measure.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-char-width.returns"></a><h4>Returns</h4> <p> the width of the character in pixels.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-char-width-wc"></a><h3>gdk_char_width_wc ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gdk_char_width_wc (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>, <em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkWChar" title="GdkWChar"><span class="type">GdkWChar</span></a> character</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_char_width_wc</code> is deprecated and should not be used in newly-written code.</p></div> <p>Determines the width of a given wide character. (Encoded in the wide-character encoding of the current locale).</p> <div class="refsect3"> <a name="gdk-char-width-wc.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>character</p></td> <td class="parameter_description"><p>the character to measure.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-char-width-wc.returns"></a><h4>Returns</h4> <p> the width of the character in pixels.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-string-measure"></a><h3>gdk_string_measure ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gdk_string_measure (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>, <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_string_measure</code> is deprecated and should not be used in newly-written code.</p></div> <p>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 <a class="link" href="gdk2-Fonts.html#gdk-string-width" title="gdk_string_width ()"><code class="function">gdk_string_width()</code></a>.</p> <div class="refsect3"> <a name="gdk-string-measure.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>string</p></td> <td class="parameter_description"><p>the nul-terminated string to measure.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-string-measure.returns"></a><h4>Returns</h4> <p> the right bearing of the string in pixels.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-text-measure"></a><h3>gdk_text_measure ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gdk_text_measure (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>, <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> text_length</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_text_measure</code> is deprecated and should not be used in newly-written code.</p></div> <p>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 <a class="link" href="gdk2-Fonts.html#gdk-text-width" title="gdk_text_width ()"><code class="function">gdk_text_width()</code></a>.</p> <div class="refsect3"> <a name="gdk-text-measure.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>text</p></td> <td class="parameter_description"><p>the text to measure.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>text_length</p></td> <td class="parameter_description"><p>the length of the text in bytes.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-text-measure.returns"></a><h4>Returns</h4> <p> the right bearing of the string in pixels.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-char-measure"></a><h3>gdk_char_measure ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gdk_char_measure (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> character</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_char_measure</code> is deprecated and should not be used in newly-written code.</p></div> <p>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.</p> <div class="refsect3"> <a name="gdk-char-measure.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>character</p></td> <td class="parameter_description"><p>the character to measure.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-char-measure.returns"></a><h4>Returns</h4> <p> the right bearing of the character in pixels.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-string-height"></a><h3>gdk_string_height ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gdk_string_height (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>, <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_string_height</code> is deprecated and should not be used in newly-written code.</p></div> <p>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 <a class="link" href="gdk2-Fonts.html#gdk-string-extents" title="gdk_string_extents ()"><code class="function">gdk_string_extents()</code></a>.</p> <div class="refsect3"> <a name="gdk-string-height.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>string</p></td> <td class="parameter_description"><p>the nul-terminated string to measure.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-string-height.returns"></a><h4>Returns</h4> <p> the height of the string in pixels.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-text-height"></a><h3>gdk_text_height ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gdk_text_height (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>, <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *text</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> text_length</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_text_height</code> is deprecated and should not be used in newly-written code.</p></div> <p>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 <a class="link" href="gdk2-Fonts.html#gdk-text-extents" title="gdk_text_extents ()"><code class="function">gdk_text_extents()</code></a>.</p> <div class="refsect3"> <a name="gdk-text-height.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>text</p></td> <td class="parameter_description"><p>the text to measure.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>text_length</p></td> <td class="parameter_description"><p>the length of the text in bytes.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-text-height.returns"></a><h4>Returns</h4> <p> the height of the string in pixels.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-char-height"></a><h3>gdk_char_height ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gdk_char_height (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a> *font</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> character</code></em>);</pre> <div class="warning"> <p><code class="literal">gdk_char_height</code> has been deprecated since version 2.2 and should not be used in newly-written code.</p> <p>Use <a class="link" href="gdk2-Fonts.html#gdk-text-extents" title="gdk_text_extents ()"><code class="function">gdk_text_extents()</code></a> instead.</p> </div> <p>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 <a class="link" href="gdk2-Fonts.html#gdk-text-extents" title="gdk_text_extents ()"><code class="function">gdk_text_extents()</code></a>.</p> <div class="refsect3"> <a name="gdk-char-height.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>font</p></td> <td class="parameter_description"><p>a <a class="link" href="gdk2-Fonts.html#GdkFont" title="GdkFont"><span class="type">GdkFont</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>character</p></td> <td class="parameter_description"><p>the character to measure.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-char-height.returns"></a><h4>Returns</h4> <p> the height of the character in pixels.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-wcstombs"></a><h3>gdk_wcstombs ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gdk_wcstombs (<em class="parameter"><code>const <a class="link" href="gdk2-Fonts.html#GdkWChar" title="GdkWChar"><span class="type">GdkWChar</span></a> *src</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_wcstombs</code> is deprecated and should not be used in newly-written code.</p></div> <p>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').</p> <div class="refsect3"> <a name="gdk-wcstombs.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>src</p></td> <td class="parameter_description"><p>a wide character string.</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-wcstombs.returns"></a><h4>Returns</h4> <p> the multi-byte string corresponding to <em class="parameter"><code>src</code></em> , or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the conversion failed. The returned string should be freed with <a href="https://developer.gnome.org/glib/unstable/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a> when no longer needed.</p> </div> </div> <hr> <div class="refsect2"> <a name="gdk-mbstowcs"></a><h3>gdk_mbstowcs ()</h3> <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> gdk_mbstowcs (<em class="parameter"><code><a class="link" href="gdk2-Fonts.html#GdkWChar" title="GdkWChar"><span class="type">GdkWChar</span></a> *dest</code></em>, <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *src</code></em>, <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> dest_max</code></em>);</pre> <div class="warning"><p><code class="literal">gdk_mbstowcs</code> is deprecated and should not be used in newly-written code.</p></div> <p>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').</p> <div class="refsect3"> <a name="gdk-mbstowcs.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>dest</p></td> <td class="parameter_description"><p>the space to place the converted wide character string into.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>src</p></td> <td class="parameter_description"><p>the multi-byte string to convert, which must be nul-terminated.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>dest_max</p></td> <td class="parameter_description"><p>the maximum number of wide characters to place in <em class="parameter"><code>dest</code></em> .</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="gdk-mbstowcs.returns"></a><h4>Returns</h4> <p> the number of wide characters written into <em class="parameter"><code>dest</code></em> , or -1 if the conversion failed.</p> </div> </div> </div> <div class="refsect1"> <a name="gdk2-Fonts.other_details"></a><h2>Types and Values</h2> <div class="refsect2"> <a name="GdkFont"></a><h3>GdkFont</h3> <pre class="programlisting">typedef struct { GdkFontType type; gint ascent; gint descent; } GdkFont; </pre> <div class="warning"><p><code class="literal">GdkFont</code> is deprecated and should not be used in newly-written code.</p></div> <p> The <span class="structname">GdkFont</span> structure represents a font or fontset. It contains the following public fields. A new <span class="structname">GdkFont</span> structure is returned by <a class="link" href="gdk2-Fonts.html#gdk-font-load" title="gdk_font_load ()"><code class="function">gdk_font_load()</code></a> or <a class="link" href="gdk2-Fonts.html#gdk-fontset-load" title="gdk_fontset_load ()"><code class="function">gdk_fontset_load()</code></a>, and is reference counted with <a class="link" href="gdk2-Fonts.html#gdk-font-ref" title="gdk_font_ref ()"><code class="function">gdk_font_ref()</code></a> and <a class="link" href="gdk2-Fonts.html#gdk-font-unref" title="gdk_font_unref ()"><code class="function">gdk_font_unref()</code></a> </p> <div class="refsect3"> <a name="GdkFont.members"></a><h4>Members</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="300px" class="struct_members_name"> <col class="struct_members_description"> <col width="200px" class="struct_members_annotations"> </colgroup> <tbody> <tr> <td class="struct_member_name"><p><a class="link" href="gdk2-Fonts.html#GdkFontType" title="enum GdkFontType"><span class="type">GdkFontType</span></a> <em class="structfield"><code><a name="GdkFont.type"></a>type</code></em>;</p></td> <td class="struct_member_description"><p>a value of type <a class="link" href="gdk2-Fonts.html#GdkFontType" title="enum GdkFontType"><span class="type">GdkFontType</span></a> which indicates whether this font is a single font or a fontset.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GdkFont.ascent"></a>ascent</code></em>;</p></td> <td class="struct_member_description"><p>the maximum distance that the font, when drawn, ascends above the baseline.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GdkFont.descent"></a>descent</code></em>;</p></td> <td class="struct_member_description"><p>the maximum distance that the font, when drawn, descends below the baseline.</p></td> <td class="struct_member_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="GdkFontType"></a><h3>enum GdkFontType</h3> <div class="warning"><p><code class="literal">GdkFontType</code> is deprecated and should not be used in newly-written code.</p></div> <p> Indicates the type of a font. The possible values are currently: </p> <div class="refsect3"> <a name="GdkFontType.members"></a><h4>Members</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="GDK-FONT-FONT:CAPS"></a>GDK_FONT_FONT</p></td> <td class="enum_member_description"> <p>the font is a single font.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="GDK-FONT-FONTSET:CAPS"></a>GDK_FONT_FONTSET</p></td> <td class="enum_member_description"> <p>the font is a fontset.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="GdkWChar"></a><h3>GdkWChar</h3> <pre class="programlisting">typedef guint32 GdkWChar; </pre> <p> 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). </p> <p> 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. </p> <p> 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. </p> <p> Applications typically use wide characters to represent character codes internally, and multi-byte strings when saving the characters to a file. The <a class="link" href="gdk2-Fonts.html#gdk-wcstombs" title="gdk_wcstombs ()"><code class="function">gdk_wcstombs()</code></a> and <a class="link" href="gdk2-Fonts.html#gdk-mbstowcs" title="gdk_mbstowcs ()"><code class="function">gdk_mbstowcs()</code></a> functions can be used to convert from one representation to the other. </p> <p> See the 'Extended Characters' section of the GNU C Library Reference Manual for more detailed information on wide and multi-byte characters. </p> </div> </div> </div> <div class="footer"> <hr>Generated by GTK-Doc V1.24.1</div> </body> </html>