~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to docs/reference/gdk/xml/fonts.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<refentry id="gdk-Fonts">
 
2
<refmeta>
 
3
<refentrytitle role="top_of_page">Fonts</refentrytitle>
 
4
<manvolnum>3</manvolnum>
 
5
<refmiscinfo>GDK Library</refmiscinfo>
 
6
</refmeta>
 
7
 
 
8
<refnamediv>
 
9
<refname>Fonts</refname>
 
10
<refpurpose>Loading and manipulating fonts</refpurpose>
 
11
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
 
12
</refnamediv>
 
13
 
 
14
<refsynopsisdiv role="synopsis">
 
15
<title role="synopsis.title">Synopsis</title>
 
16
 
 
17
<synopsis>
 
18
 
 
19
#include &lt;gdk/gdk.h&gt;
 
20
 
 
21
 
 
22
                    <link linkend="GdkFont">GdkFont</link>;
 
23
enum                <link linkend="GdkFontType">GdkFontType</link>;
 
24
<link linkend="GdkFont">GdkFont</link>*            <link linkend="gdk-font-load">gdk_font_load</link>                       (const <link linkend="gchar">gchar</link> *font_name);
 
25
<link linkend="GdkFont">GdkFont</link>*            <link linkend="gdk-font-load-for-display">gdk_font_load_for_display</link>           (<link linkend="GdkDisplay">GdkDisplay</link> *display,
 
26
                                                         const <link linkend="gchar">gchar</link> *font_name);
 
27
<link linkend="GdkFont">GdkFont</link>*            <link linkend="gdk-fontset-load">gdk_fontset_load</link>                    (const <link linkend="gchar">gchar</link> *fontset_name);
 
28
<link linkend="GdkFont">GdkFont</link>*            <link linkend="gdk-fontset-load-for-display">gdk_fontset_load_for_display</link>        (<link linkend="GdkDisplay">GdkDisplay</link> *display,
 
29
                                                         const <link linkend="gchar">gchar</link> *fontset_name);
 
30
<link linkend="GdkFont">GdkFont</link>*            <link linkend="gdk-font-from-description">gdk_font_from_description</link>           (<link linkend="PangoFontDescription">PangoFontDescription</link> *font_desc);
 
31
<link linkend="GdkFont">GdkFont</link>*            <link linkend="gdk-font-from-description-for-display">gdk_font_from_description_for_display</link>
 
32
                                                        (<link linkend="GdkDisplay">GdkDisplay</link> *display,
 
33
                                                         <link linkend="PangoFontDescription">PangoFontDescription</link> *font_desc);
 
34
<link linkend="GdkDisplay">GdkDisplay</link>*         <link linkend="gdk-font-get-display">gdk_font_get_display</link>                (<link linkend="GdkFont">GdkFont</link> *font);
 
35
<link linkend="GdkFont">GdkFont</link>*            <link linkend="gdk-font-ref">gdk_font_ref</link>                        (<link linkend="GdkFont">GdkFont</link> *font);
 
36
<link linkend="void">void</link>                <link linkend="gdk-font-unref">gdk_font_unref</link>                      (<link linkend="GdkFont">GdkFont</link> *font);
 
37
<link linkend="gint">gint</link>                <link linkend="gdk-font-id">gdk_font_id</link>                         (const <link linkend="GdkFont">GdkFont</link> *font);
 
38
<link linkend="gboolean">gboolean</link>            <link linkend="gdk-font-equal">gdk_font_equal</link>                      (const <link linkend="GdkFont">GdkFont</link> *fonta,
 
39
                                                         const <link linkend="GdkFont">GdkFont</link> *fontb);
 
40
 
 
41
<link linkend="void">void</link>                <link linkend="gdk-string-extents">gdk_string_extents</link>                  (<link linkend="GdkFont">GdkFont</link> *font,
 
42
                                                         const <link linkend="gchar">gchar</link> *string,
 
43
                                                         <link linkend="gint">gint</link> *lbearing,
 
44
                                                         <link linkend="gint">gint</link> *rbearing,
 
45
                                                         <link linkend="gint">gint</link> *width,
 
46
                                                         <link linkend="gint">gint</link> *ascent,
 
47
                                                         <link linkend="gint">gint</link> *descent);
 
48
<link linkend="void">void</link>                <link linkend="gdk-text-extents">gdk_text_extents</link>                    (<link linkend="GdkFont">GdkFont</link> *font,
 
49
                                                         const <link linkend="gchar">gchar</link> *text,
 
50
                                                         <link linkend="gint">gint</link> text_length,
 
51
                                                         <link linkend="gint">gint</link> *lbearing,
 
52
                                                         <link linkend="gint">gint</link> *rbearing,
 
53
                                                         <link linkend="gint">gint</link> *width,
 
54
                                                         <link linkend="gint">gint</link> *ascent,
 
55
                                                         <link linkend="gint">gint</link> *descent);
 
56
<link linkend="void">void</link>                <link linkend="gdk-text-extents-wc">gdk_text_extents_wc</link>                 (<link linkend="GdkFont">GdkFont</link> *font,
 
57
                                                         const <link linkend="GdkWChar">GdkWChar</link> *text,
 
58
                                                         <link linkend="gint">gint</link> text_length,
 
59
                                                         <link linkend="gint">gint</link> *lbearing,
 
60
                                                         <link linkend="gint">gint</link> *rbearing,
 
61
                                                         <link linkend="gint">gint</link> *width,
 
62
                                                         <link linkend="gint">gint</link> *ascent,
 
63
                                                         <link linkend="gint">gint</link> *descent);
 
64
<link linkend="gint">gint</link>                <link linkend="gdk-string-width">gdk_string_width</link>                    (<link linkend="GdkFont">GdkFont</link> *font,
 
65
                                                         const <link linkend="gchar">gchar</link> *string);
 
66
<link linkend="gint">gint</link>                <link linkend="gdk-text-width">gdk_text_width</link>                      (<link linkend="GdkFont">GdkFont</link> *font,
 
67
                                                         const <link linkend="gchar">gchar</link> *text,
 
68
                                                         <link linkend="gint">gint</link> text_length);
 
69
<link linkend="gint">gint</link>                <link linkend="gdk-text-width-wc">gdk_text_width_wc</link>                   (<link linkend="GdkFont">GdkFont</link> *font,
 
70
                                                         const <link linkend="GdkWChar">GdkWChar</link> *text,
 
71
                                                         <link linkend="gint">gint</link> text_length);
 
72
<link linkend="gint">gint</link>                <link linkend="gdk-char-width">gdk_char_width</link>                      (<link linkend="GdkFont">GdkFont</link> *font,
 
73
                                                         <link linkend="gchar">gchar</link> character);
 
74
<link linkend="gint">gint</link>                <link linkend="gdk-char-width-wc">gdk_char_width_wc</link>                   (<link linkend="GdkFont">GdkFont</link> *font,
 
75
                                                         <link linkend="GdkWChar">GdkWChar</link> character);
 
76
<link linkend="gint">gint</link>                <link linkend="gdk-string-measure">gdk_string_measure</link>                  (<link linkend="GdkFont">GdkFont</link> *font,
 
77
                                                         const <link linkend="gchar">gchar</link> *string);
 
78
<link linkend="gint">gint</link>                <link linkend="gdk-text-measure">gdk_text_measure</link>                    (<link linkend="GdkFont">GdkFont</link> *font,
 
79
                                                         const <link linkend="gchar">gchar</link> *text,
 
80
                                                         <link linkend="gint">gint</link> text_length);
 
81
<link linkend="gint">gint</link>                <link linkend="gdk-char-measure">gdk_char_measure</link>                    (<link linkend="GdkFont">GdkFont</link> *font,
 
82
                                                         <link linkend="gchar">gchar</link> character);
 
83
<link linkend="gint">gint</link>                <link linkend="gdk-string-height">gdk_string_height</link>                   (<link linkend="GdkFont">GdkFont</link> *font,
 
84
                                                         const <link linkend="gchar">gchar</link> *string);
 
85
<link linkend="gint">gint</link>                <link linkend="gdk-text-height">gdk_text_height</link>                     (<link linkend="GdkFont">GdkFont</link> *font,
 
86
                                                         const <link linkend="gchar">gchar</link> *text,
 
87
                                                         <link linkend="gint">gint</link> text_length);
 
88
<link linkend="gint">gint</link>                <link linkend="gdk-char-height">gdk_char_height</link>                     (<link linkend="GdkFont">GdkFont</link> *font,
 
89
                                                         <link linkend="gchar">gchar</link> character);
 
90
 
 
91
typedef             <link linkend="GdkWChar">GdkWChar</link>;
 
92
<link linkend="gchar">gchar</link>*              <link linkend="gdk-wcstombs">gdk_wcstombs</link>                        (const <link linkend="GdkWChar">GdkWChar</link> *src);
 
93
<link linkend="gint">gint</link>                <link linkend="gdk-mbstowcs">gdk_mbstowcs</link>                        (<link linkend="GdkWChar">GdkWChar</link> *dest,
 
94
                                                         const <link linkend="gchar">gchar</link> *src,
 
95
                                                         <link linkend="gint">gint</link> dest_max);
 
96
 
 
97
 
 
98
</synopsis>
 
99
</refsynopsisdiv>
 
100
 
 
101
 
 
102
 
 
103
 
 
104
 
 
105
 
 
106
 
 
107
 
 
108
 
 
109
<refsect1 role="desc">
 
110
<title role="desc.title">Description</title>
 
111
<para>
 
112
The <link linkend="GdkFont"><type>GdkFont</type></link> data type represents a font for drawing on
 
113
the screen. These functions provide support for
 
114
loading fonts, and also for determining the dimensions
 
115
of characters and strings when drawn with a particular
 
116
font.
 
117
</para>
 
118
 
 
119
<para>
 
120
Fonts in X are specified by a
 
121
<firstterm>X Logical Font Description</firstterm>. 
 
122
The following description is considerably simplified.
 
123
For definitive information about XLFD's see the 
 
124
X reference documentation. A X Logical Font Description (XLFD)
 
125
consists of a sequence of fields separated (and surrounded by) '-'
 
126
characters. For example, Adobe Helvetica Bold 12 pt, has the
 
127
full description: 
 
128
<informalexample><programlisting>
 
129
"-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1"
 
130
</programlisting></informalexample>
 
131
</para>
 
132
 
 
133
<para>
 
134
The fields in the XLFD are:
 
135
 
 
136
<informaltable pgwide="1" frame="none">
 
137
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
 
138
<tbody>
 
139
 
 
140
<row>
 
141
<entry>Foundry</entry>
 
142
<entry>the company or organization where the font originated.</entry>
 
143
</row>
 
144
 
 
145
<row>
 
146
<entry>Family</entry>
 
147
<entry>the font family (a group of related font designs).</entry>
 
148
</row>
 
149
 
 
150
<row>
 
151
<entry>Weight</entry>
 
152
<entry>A name for the font's typographic weight
 
153
For example, 'bold' or 'medium').</entry>
 
154
</row>
 
155
 
 
156
<row>
 
157
<entry>Slant</entry>
 
158
<entry>The slant of the font. Common values are 'R' for Roman,
 
159
'I' for italoc, and 'O' for oblique.</entry>
 
160
</row>
 
161
 
 
162
<row>
 
163
<entry>Set Width</entry>
 
164
<entry>A name for the width of the font. For example,
 
165
'normal' or 'condensed'.</entry>
 
166
</row>
 
167
 
 
168
<row>
 
169
<entry>Add Style</entry>
 
170
<entry>Additional information to distinguish a font from
 
171
other fonts of the same family.</entry>
 
172
</row>
 
173
 
 
174
<row>
 
175
<entry>Pixel Size</entry>
 
176
<entry>The body size of the font in pixels.</entry>
 
177
</row>
 
178
 
 
179
<row>
 
180
<entry>Point Size</entry>
 
181
<entry>The body size of the font in 10ths of a point.
 
182
(A <firstterm>point</firstterm> is 1/72.27 inch) </entry>
 
183
</row>
 
184
 
 
185
<row>
 
186
<entry>Resolution X</entry>
 
187
<entry>The horizontal resolution that the font was designed for.</entry>
 
188
</row>
 
189
 
 
190
<row>
 
191
<entry>Resolution Y</entry>
 
192
<entry>The vertical resolution that the font was designed for .</entry>
 
193
</row>
 
194
 
 
195
<row>
 
196
<entry>Spacing</entry>
 
197
<entry>The type of spacing for the font - can be 'p' for proportional,
 
198
'm' for monospaced or 'c' for charcell.</entry>
 
199
</row>
 
200
 
 
201
<row>
 
202
<entry>Average Width</entry>
 
203
<entry>The average width of a glyph in the font. For monospaced
 
204
and charcell fonts, all glyphs in the font have this width</entry>
 
205
</row>
 
206
 
 
207
<row>
 
208
<entry>Charset Registry</entry>
 
209
<entry>The registration authority that owns the encoding for
 
210
the font. Together with the Charset Encoding field, this
 
211
defines the character set for the font.</entry>
 
212
</row>
 
213
 
 
214
<row>
 
215
<entry>Charset Encoding</entry>
 
216
<entry>An identifier for the particular character set encoding.</entry>
 
217
</row>
 
218
 
 
219
</tbody></tgroup></informaltable>
 
220
</para>
 
221
 
 
222
<para>
 
223
When specifying a font via a X logical Font Description,
 
224
'*' can be used as a wildcard to match any portion of
 
225
the XLFD. For instance, the above example could
 
226
also be specified as
 
227
<informalexample><programlisting>
 
228
"-*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1"
 
229
</programlisting></informalexample>
 
230
 
 
231
It is generally a good idea to use wildcards for any
 
232
portion of the XLFD that your program does not care
 
233
about specifically, since that will improve the
 
234
chances of finding a matching font.
 
235
</para>
 
236
 
 
237
<para>
 
238
A <firstterm>fontset</firstterm> is a list of fonts
 
239
that is used for drawing international text that may
 
240
contain characters from a number of different character
 
241
sets. It is represented by a list of XLFD's. 
 
242
</para>
 
243
 
 
244
<para>
 
245
The font for a given character set is determined by going
 
246
through the list of XLFD's in order. For each one, if
 
247
the registry and and encoding fields match the desired
 
248
character set, then that font is used, otherwise if
 
249
the XLFD contains wild-cards for the registry and encoding
 
250
fields, the registry and encoding for the desired character
 
251
set are substituted in and a lookup is done. If a match is found
 
252
that font is used. Otherwise, processing continues
 
253
on to the next font in the list.
 
254
</para>
 
255
 
 
256
<para>
 
257
The functions for determining the metrics of a string
 
258
come in several varieties that can take a number
 
259
of forms of string input:
 
260
 
 
261
<variablelist>
 
262
  <varlistentry>
 
263
    <term>8-bit string</term>
 
264
    <listitem><para>
 
265
    When using functions like <link linkend="gdk-string-width"><function>gdk_string_width()</function></link> that
 
266
    take a <type>gchar *</type>, if the font is of type
 
267
    <link linkend="GDK-FONT-FONT:CAPS"><literal>GDK_FONT_FONT</literal></link> and is an 8-bit font, then each
 
268
    <type>gchar</type> indexes the glyphs in the font directly.
 
269
    </para></listitem>
 
270
  </varlistentry>
 
271
  <varlistentry>
 
272
    <term>16-bit string</term>
 
273
    <listitem><para>
 
274
    For functions taking a <type>gchar *</type>, if the
 
275
    font is of type <link linkend="GDK-FONT-FONT:CAPS"><literal>GDK_FONT_FONT</literal></link>, and is a 16-bit
 
276
    font, then the <type>gchar *</type> argument is
 
277
    interpreted as a <type>guint16 *</type> cast to
 
278
    a <type>gchar *</type> and each <type>guint16</type>
 
279
    indexes the glyphs in the font directly.
 
280
    </para></listitem>
 
281
  </varlistentry>
 
282
  <varlistentry>
 
283
    <term>Multibyte string</term>
 
284
    <listitem><para>
 
285
    For functions taking a <type>gchar *</type>, if the
 
286
    font is of type <link linkend="GDK-FONT-FONTSET:CAPS"><literal>GDK_FONT_FONTSET</literal></link>, then the input
 
287
    string is interpreted as a <firstterm>multibyte</firstterm>
 
288
    encoded according to the current locale. (A multibyte
 
289
    string is one in which each character may consist
 
290
    of one or more bytes, with different lengths for different
 
291
    characters in the string). They can be converted to and
 
292
    from wide character strings (see below) using
 
293
    <link linkend="gdk-wcstombs"><function>gdk_wcstombs()</function></link> and <link linkend="gdk-mbstowcs"><function>gdk_mbstowcs()</function></link>.) The string will
 
294
    be rendered using one or more different fonts from
 
295
    the fontset.
 
296
    </para></listitem>
 
297
  </varlistentry>
 
298
  <varlistentry>
 
299
    <term>Wide character string</term>
 
300
    <listitem><para>
 
301
    For a number of the text-measuring functions, GDK
 
302
    provides a variant (such as <link linkend="gdk-text-width-wc"><function>gdk_text_width_wc()</function></link>) which
 
303
    takes a <type>GdkWChar *</type> instead of a 
 
304
    <type>gchar *</type>. The input is then taken to
 
305
    be a wide character string in the encoding of the
 
306
    current locale. (A wide character string is a string
 
307
    in which each character consists of several bytes,
 
308
    and the width of each character in the string is 
 
309
    constant.)
 
310
    </para></listitem>
 
311
  </varlistentry>
 
312
</variablelist>
 
313
</para>
 
314
 
 
315
<para>
 
316
GDK provides functions to determine a number of different
 
317
measurements (metrics) for a given string. (Need diagram
 
318
here).
 
319
 
 
320
<variablelist>
 
321
  <varlistentry>
 
322
    <term>ascent</term>
 
323
    <listitem><para>
 
324
    The vertical distance from the origin of the drawing
 
325
    opereration to the top of the drawn character.
 
326
    </para></listitem>
 
327
  </varlistentry>
 
328
  <varlistentry>
 
329
    <term>descent</term>
 
330
    <listitem><para>
 
331
    The vertical distance from the origin of the drawing
 
332
    opereration to the bottom of the drawn character.
 
333
    </para></listitem>
 
334
  </varlistentry>
 
335
  <varlistentry>
 
336
    <term>left bearing</term>
 
337
    <listitem><para>
 
338
    The horizontal distance from the origin of the drawing
 
339
    operation to the left-most part of the drawn character.
 
340
    </para></listitem>
 
341
  </varlistentry>
 
342
  <varlistentry>
 
343
    <term>right bearing</term>
 
344
    <listitem><para>
 
345
    The horizontal distance from the origin of the drawing
 
346
    operation to the right-most part of the drawn character.
 
347
    </para></listitem>
 
348
  </varlistentry>
 
349
  <varlistentry>
 
350
    <term>width bearing</term>
 
351
    <listitem><para>
 
352
    The horizontal distance from the origin of the drawing
 
353
    operation to the correct origin for drawing another
 
354
    string to follow the current one. Depending on the
 
355
    font, this could be greater than or less than the 
 
356
    right bearing.
 
357
    </para></listitem>
 
358
  </varlistentry>
 
359
</variablelist>
 
360
</para>
 
361
</refsect1>
 
362
 
 
363
<refsect1 role="details">
 
364
<title role="details.title">Details</title>
 
365
<refsect2>
 
366
<title><anchor id="GdkFont" role="struct" condition="deprecated:"/>GdkFont</title>
 
367
<indexterm role="deprecated"><primary>GdkFont</primary></indexterm><programlisting>typedef struct {
 
368
  GdkFontType type;
 
369
  gint ascent;
 
370
  gint descent;
 
371
} GdkFont;
 
372
</programlisting>
 
373
<warning><para><literal>GdkFont</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
374
<para>
 
375
The <structname>GdkFont</structname> structure represents a font or fontset. It
 
376
contains the following public fields. A new <structname>GdkFont</structname>
 
377
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>,
 
378
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>
 
379
</para><variablelist role="struct">
 
380
<varlistentry>
 
381
<term><link linkend="GdkFontType">GdkFontType</link>&nbsp;<structfield>type</structfield>;</term>
 
382
<listitem><simpara>a value of type <link linkend="GdkFontType"><type>GdkFontType</type></link> which indicates
 
383
  whether this font is a single font or a fontset.
 
384
</simpara></listitem>
 
385
</varlistentry>
 
386
<varlistentry>
 
387
<term><link linkend="gint">gint</link>&nbsp;<structfield>ascent</structfield>;</term>
 
388
<listitem><simpara>the maximum distance that the font, when drawn,
 
389
  ascends above the baseline.
 
390
</simpara></listitem>
 
391
</varlistentry>
 
392
<varlistentry>
 
393
<term><link linkend="gint">gint</link>&nbsp;<structfield>descent</structfield>;</term>
 
394
<listitem><simpara>the maximum distance that the font, when drawn,
 
395
descends below the baseline.
 
396
 
 
397
</simpara></listitem>
 
398
</varlistentry>
 
399
</variablelist></refsect2>
 
400
<refsect2>
 
401
<title><anchor id="GdkFontType" role="enum" condition="deprecated:"/>enum GdkFontType</title>
 
402
<indexterm role="deprecated"><primary>GdkFontType</primary></indexterm><programlisting>typedef enum
 
403
{
 
404
  GDK_FONT_FONT,
 
405
  GDK_FONT_FONTSET
 
406
} GdkFontType;
 
407
</programlisting>
 
408
<warning><para><literal>GdkFontType</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
409
<para>
 
410
Indicates the type of a font. The possible values
 
411
are currently:
 
412
</para><variablelist role="enum">
 
413
<varlistentry>
 
414
<term><anchor id="GDK-FONT-FONT:CAPS" role="constant"/><literal>GDK_FONT_FONT</literal></term>
 
415
<listitem><simpara>the font is a single font.
 
416
</simpara></listitem>
 
417
</varlistentry>
 
418
<varlistentry>
 
419
<term><anchor id="GDK-FONT-FONTSET:CAPS" role="constant"/><literal>GDK_FONT_FONTSET</literal></term>
 
420
<listitem><simpara>the font is a fontset.
 
421
 
 
422
</simpara></listitem>
 
423
</varlistentry>
 
424
</variablelist></refsect2>
 
425
<refsect2>
 
426
<title><anchor id="gdk-font-load" role="function" condition="deprecated:"/>gdk_font_load ()</title>
 
427
<indexterm role="deprecated"><primary>gdk_font_load</primary></indexterm><programlisting><link linkend="GdkFont">GdkFont</link>*            gdk_font_load                       (const <link linkend="gchar">gchar</link> *font_name);</programlisting>
 
428
<warning><para><literal>gdk_font_load</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
429
<para>
 
430
Loads a font.
 
431
</para>
 
432
<para>
 
433
The font may be newly loaded or looked up the font in a cache. 
 
434
You should make no assumptions about the initial reference count.</para>
 
435
<para>
 
436
</para><variablelist role="params">
 
437
<varlistentry><term><parameter>font_name</parameter>&nbsp;:</term>
 
438
<listitem><simpara> a XLFD describing the font to load.
 
439
</simpara></listitem></varlistentry>
 
440
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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.
 
441
</simpara></listitem></varlistentry>
 
442
</variablelist></refsect2>
 
443
<refsect2>
 
444
<title><anchor id="gdk-font-load-for-display" role="function" condition="deprecated:|since:2.2"/>gdk_font_load_for_display ()</title>
 
445
<indexterm role="deprecated"><primary>gdk_font_load_for_display</primary></indexterm><indexterm role="2.2"><primary>gdk_font_load_for_display</primary></indexterm><programlisting><link linkend="GdkFont">GdkFont</link>*            gdk_font_load_for_display           (<link linkend="GdkDisplay">GdkDisplay</link> *display,
 
446
                                                         const <link linkend="gchar">gchar</link> *font_name);</programlisting>
 
447
<warning><para><literal>gdk_font_load_for_display</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
448
<para>
 
449
Loads a font for use on <parameter>display</parameter>.
 
450
</para>
 
451
<para>
 
452
The font may be newly loaded or looked up the font in a cache. 
 
453
You should make no assumptions about the initial reference count.</para>
 
454
<para>
 
455
 
 
456
</para><variablelist role="params">
 
457
<varlistentry><term><parameter>display</parameter>&nbsp;:</term>
 
458
<listitem><simpara> a <link linkend="GdkDisplay"><type>GdkDisplay</type></link>
 
459
</simpara></listitem></varlistentry>
 
460
<varlistentry><term><parameter>font_name</parameter>&nbsp;:</term>
 
461
<listitem><simpara> a XLFD describing the font to load.
 
462
</simpara></listitem></varlistentry>
 
463
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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.
 
464
</simpara></listitem></varlistentry>
 
465
</variablelist><para role="since">Since  2.2
 
466
</para></refsect2>
 
467
<refsect2>
 
468
<title><anchor id="gdk-fontset-load" role="function" condition="deprecated:"/>gdk_fontset_load ()</title>
 
469
<indexterm role="deprecated"><primary>gdk_fontset_load</primary></indexterm><programlisting><link linkend="GdkFont">GdkFont</link>*            gdk_fontset_load                    (const <link linkend="gchar">gchar</link> *fontset_name);</programlisting>
 
470
<warning><para><literal>gdk_fontset_load</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
471
<para>
 
472
Loads a fontset.
 
473
</para>
 
474
<para>
 
475
The fontset may be newly loaded or looked up in a cache. 
 
476
You should make no assumptions about the initial reference count.</para>
 
477
<para>
 
478
</para><variablelist role="params">
 
479
<varlistentry><term><parameter>fontset_name</parameter>&nbsp;:</term>
 
480
<listitem><simpara> a comma-separated list of XLFDs describing
 
481
    the component fonts of the fontset to load.
 
482
</simpara></listitem></varlistentry>
 
483
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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.
 
484
</simpara></listitem></varlistentry>
 
485
</variablelist></refsect2>
 
486
<refsect2>
 
487
<title><anchor id="gdk-fontset-load-for-display" role="function" condition="deprecated:|since:2.2"/>gdk_fontset_load_for_display ()</title>
 
488
<indexterm role="deprecated"><primary>gdk_fontset_load_for_display</primary></indexterm><indexterm role="2.2"><primary>gdk_fontset_load_for_display</primary></indexterm><programlisting><link linkend="GdkFont">GdkFont</link>*            gdk_fontset_load_for_display        (<link linkend="GdkDisplay">GdkDisplay</link> *display,
 
489
                                                         const <link linkend="gchar">gchar</link> *fontset_name);</programlisting>
 
490
<warning><para><literal>gdk_fontset_load_for_display</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
491
<para>
 
492
Loads a fontset for use on <parameter>display</parameter>.
 
493
</para>
 
494
<para>
 
495
The fontset may be newly loaded or looked up in a cache. 
 
496
You should make no assumptions about the initial reference count.</para>
 
497
<para>
 
498
 
 
499
</para><variablelist role="params">
 
500
<varlistentry><term><parameter>display</parameter>&nbsp;:</term>
 
501
<listitem><simpara> a <link linkend="GdkDisplay"><type>GdkDisplay</type></link>
 
502
</simpara></listitem></varlistentry>
 
503
<varlistentry><term><parameter>fontset_name</parameter>&nbsp;:</term>
 
504
<listitem><simpara> a comma-separated list of XLFDs describing
 
505
  the component fonts of the fontset to load.
 
506
</simpara></listitem></varlistentry>
 
507
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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.
 
508
</simpara></listitem></varlistentry>
 
509
</variablelist><para role="since">Since  2.2
 
510
</para></refsect2>
 
511
<refsect2>
 
512
<title><anchor id="gdk-font-from-description" role="function" condition="deprecated:"/>gdk_font_from_description ()</title>
 
513
<indexterm role="deprecated"><primary>gdk_font_from_description</primary></indexterm><programlisting><link linkend="GdkFont">GdkFont</link>*            gdk_font_from_description           (<link linkend="PangoFontDescription">PangoFontDescription</link> *font_desc);</programlisting>
 
514
<warning><para><literal>gdk_font_from_description</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
515
<para>
 
516
Load a <link linkend="GdkFont"><type>GdkFont</type></link> based on a Pango font description. This font will
 
517
only be an approximation of the Pango font, and
 
518
internationalization will not be handled correctly. This function
 
519
should only be used for legacy code that cannot be easily converted
 
520
to use Pango. Using Pango directly will produce better results.</para>
 
521
<para>
 
522
 
 
523
</para><variablelist role="params">
 
524
<varlistentry><term><parameter>font_desc</parameter>&nbsp;:</term>
 
525
<listitem><simpara> a <link linkend="PangoFontDescription"><type>PangoFontDescription</type></link>.
 
526
</simpara></listitem></varlistentry>
 
527
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly loaded font, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the font
 
528
cannot be loaded.
 
529
</simpara></listitem></varlistentry>
 
530
</variablelist></refsect2>
 
531
<refsect2>
 
532
<title><anchor id="gdk-font-from-description-for-display" role="function" condition="deprecated:|since:2.2"/>gdk_font_from_description_for_display ()</title>
 
533
<indexterm role="deprecated"><primary>gdk_font_from_description_for_display</primary></indexterm><indexterm role="2.2"><primary>gdk_font_from_description_for_display</primary></indexterm><programlisting><link linkend="GdkFont">GdkFont</link>*            gdk_font_from_description_for_display
 
534
                                                        (<link linkend="GdkDisplay">GdkDisplay</link> *display,
 
535
                                                         <link linkend="PangoFontDescription">PangoFontDescription</link> *font_desc);</programlisting>
 
536
<warning><para><literal>gdk_font_from_description_for_display</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
537
<para>
 
538
Loads a <link linkend="GdkFont"><type>GdkFont</type></link> based on a Pango font description for use on <parameter>display</parameter>. 
 
539
This font will only be an approximation of the Pango font, and
 
540
internationalization will not be handled correctly. This function
 
541
should only be used for legacy code that cannot be easily converted
 
542
to use Pango. Using Pango directly will produce better results.</para>
 
543
<para>
 
544
 
 
545
</para><variablelist role="params">
 
546
<varlistentry><term><parameter>display</parameter>&nbsp;:</term>
 
547
<listitem><simpara> a <link linkend="GdkDisplay"><type>GdkDisplay</type></link>
 
548
</simpara></listitem></varlistentry>
 
549
<varlistentry><term><parameter>font_desc</parameter>&nbsp;:</term>
 
550
<listitem><simpara> a <link linkend="PangoFontDescription"><type>PangoFontDescription</type></link>.
 
551
</simpara></listitem></varlistentry>
 
552
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly loaded font, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the font
 
553
cannot be loaded.
 
554
 
 
555
</simpara></listitem></varlistentry>
 
556
</variablelist><para role="since">Since  2.2
 
557
</para></refsect2>
 
558
<refsect2>
 
559
<title><anchor id="gdk-font-get-display" role="function" condition="deprecated:|since:2.2"/>gdk_font_get_display ()</title>
 
560
<indexterm role="deprecated"><primary>gdk_font_get_display</primary></indexterm><indexterm role="2.2"><primary>gdk_font_get_display</primary></indexterm><programlisting><link linkend="GdkDisplay">GdkDisplay</link>*         gdk_font_get_display                (<link linkend="GdkFont">GdkFont</link> *font);</programlisting>
 
561
<warning><para><literal>gdk_font_get_display</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
562
<para>
 
563
Returns the <link linkend="GdkDisplay"><type>GdkDisplay</type></link> for <parameter>font</parameter>.</para>
 
564
<para>
 
565
 
 
566
</para><variablelist role="params">
 
567
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
568
<listitem><simpara> the <link linkend="GdkFont"><type>GdkFont</type></link>.
 
569
</simpara></listitem></varlistentry>
 
570
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the corresponding <link linkend="GdkDisplay"><type>GdkDisplay</type></link>.
 
571
 
 
572
</simpara></listitem></varlistentry>
 
573
</variablelist><para role="since">Since  2.2
 
574
</para></refsect2>
 
575
<refsect2>
 
576
<title><anchor id="gdk-font-ref" role="function" condition="deprecated:"/>gdk_font_ref ()</title>
 
577
<indexterm role="deprecated"><primary>gdk_font_ref</primary></indexterm><programlisting><link linkend="GdkFont">GdkFont</link>*            gdk_font_ref                        (<link linkend="GdkFont">GdkFont</link> *font);</programlisting>
 
578
<warning><para><literal>gdk_font_ref</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
579
<para>
 
580
Increases the reference count of a font by one.</para>
 
581
<para>
 
582
</para><variablelist role="params">
 
583
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
584
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
 
585
</simpara></listitem></varlistentry>
 
586
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <parameter>font</parameter>
 
587
</simpara></listitem></varlistentry>
 
588
</variablelist></refsect2>
 
589
<refsect2>
 
590
<title><anchor id="gdk-font-unref" role="function" condition="deprecated:"/>gdk_font_unref ()</title>
 
591
<indexterm role="deprecated"><primary>gdk_font_unref</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_font_unref                      (<link linkend="GdkFont">GdkFont</link> *font);</programlisting>
 
592
<warning><para><literal>gdk_font_unref</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
593
<para>
 
594
Decreases the reference count of a font by one.
 
595
If the result is zero, destroys the font.</para>
 
596
<para>
 
597
</para><variablelist role="params">
 
598
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
599
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
 
600
</simpara></listitem></varlistentry>
 
601
</variablelist></refsect2>
 
602
<refsect2>
 
603
<title><anchor id="gdk-font-id" role="function" condition="deprecated:"/>gdk_font_id ()</title>
 
604
<indexterm role="deprecated"><primary>gdk_font_id</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_font_id                         (const <link linkend="GdkFont">GdkFont</link> *font);</programlisting>
 
605
<warning><para><literal>gdk_font_id</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
606
<para>
 
607
Returns the X Font ID for the given font.</para>
 
608
<para>
 
609
</para><variablelist role="params">
 
610
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
611
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>.
 
612
</simpara></listitem></varlistentry>
 
613
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the numeric X Font ID
 
614
</simpara></listitem></varlistentry>
 
615
</variablelist></refsect2>
 
616
<refsect2>
 
617
<title><anchor id="gdk-font-equal" role="function" condition="deprecated:"/>gdk_font_equal ()</title>
 
618
<indexterm role="deprecated"><primary>gdk_font_equal</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gdk_font_equal                      (const <link linkend="GdkFont">GdkFont</link> *fonta,
 
619
                                                         const <link linkend="GdkFont">GdkFont</link> *fontb);</programlisting>
 
620
<warning><para><literal>gdk_font_equal</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
621
<para>
 
622
Compares two fonts for equality. Single fonts compare equal
 
623
if they have the same X font ID. This operation does
 
624
not currently work correctly for fontsets.</para>
 
625
<para>
 
626
</para><variablelist role="params">
 
627
<varlistentry><term><parameter>fonta</parameter>&nbsp;:</term>
 
628
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>.
 
629
</simpara></listitem></varlistentry>
 
630
<varlistentry><term><parameter>fontb</parameter>&nbsp;:</term>
 
631
<listitem><simpara> another <link linkend="GdkFont"><type>GdkFont</type></link>.
 
632
</simpara></listitem></varlistentry>
 
633
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the fonts are equal.
 
634
</simpara></listitem></varlistentry>
 
635
</variablelist></refsect2>
 
636
<refsect2>
 
637
<title><anchor id="gdk-string-extents" role="function" condition="deprecated:"/>gdk_string_extents ()</title>
 
638
<indexterm role="deprecated"><primary>gdk_string_extents</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_string_extents                  (<link linkend="GdkFont">GdkFont</link> *font,
 
639
                                                         const <link linkend="gchar">gchar</link> *string,
 
640
                                                         <link linkend="gint">gint</link> *lbearing,
 
641
                                                         <link linkend="gint">gint</link> *rbearing,
 
642
                                                         <link linkend="gint">gint</link> *width,
 
643
                                                         <link linkend="gint">gint</link> *ascent,
 
644
                                                         <link linkend="gint">gint</link> *descent);</programlisting>
 
645
<warning><para><literal>gdk_string_extents</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
646
<para>
 
647
Gets the metrics of a nul-terminated string.</para>
 
648
<para>
 
649
</para><variablelist role="params">
 
650
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
651
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>.
 
652
</simpara></listitem></varlistentry>
 
653
<varlistentry><term><parameter>string</parameter>&nbsp;:</term>
 
654
<listitem><simpara> the nul-terminated string to measure.
 
655
</simpara></listitem></varlistentry>
 
656
<varlistentry><term><parameter>lbearing</parameter>&nbsp;:</term>
 
657
<listitem><simpara> the left bearing of the string.
 
658
</simpara></listitem></varlistentry>
 
659
<varlistentry><term><parameter>rbearing</parameter>&nbsp;:</term>
 
660
<listitem><simpara> the right bearing of the string.
 
661
</simpara></listitem></varlistentry>
 
662
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
 
663
<listitem><simpara> the width of the string.
 
664
</simpara></listitem></varlistentry>
 
665
<varlistentry><term><parameter>ascent</parameter>&nbsp;:</term>
 
666
<listitem><simpara> the ascent of the string.
 
667
</simpara></listitem></varlistentry>
 
668
<varlistentry><term><parameter>descent</parameter>&nbsp;:</term>
 
669
<listitem><simpara> the descent of the string.
 
670
</simpara></listitem></varlistentry>
 
671
</variablelist></refsect2>
 
672
<refsect2>
 
673
<title><anchor id="gdk-text-extents" role="function" condition="deprecated:"/>gdk_text_extents ()</title>
 
674
<indexterm role="deprecated"><primary>gdk_text_extents</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_text_extents                    (<link linkend="GdkFont">GdkFont</link> *font,
 
675
                                                         const <link linkend="gchar">gchar</link> *text,
 
676
                                                         <link linkend="gint">gint</link> text_length,
 
677
                                                         <link linkend="gint">gint</link> *lbearing,
 
678
                                                         <link linkend="gint">gint</link> *rbearing,
 
679
                                                         <link linkend="gint">gint</link> *width,
 
680
                                                         <link linkend="gint">gint</link> *ascent,
 
681
                                                         <link linkend="gint">gint</link> *descent);</programlisting>
 
682
<warning><para><literal>gdk_text_extents</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
683
<para>
 
684
Gets the metrics of a string.</para>
 
685
<para>
 
686
</para><variablelist role="params">
 
687
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
688
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
 
689
</simpara></listitem></varlistentry>
 
690
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
 
691
<listitem><simpara> the text to measure
 
692
</simpara></listitem></varlistentry>
 
693
<varlistentry><term><parameter>text_length</parameter>&nbsp;:</term>
 
694
<listitem><simpara> the length of the text in bytes. (If the
 
695
   font is a 16-bit font, this is twice the length
 
696
   of the text in characters.)
 
697
</simpara></listitem></varlistentry>
 
698
<varlistentry><term><parameter>lbearing</parameter>&nbsp;:</term>
 
699
<listitem><simpara> the left bearing of the string.
 
700
</simpara></listitem></varlistentry>
 
701
<varlistentry><term><parameter>rbearing</parameter>&nbsp;:</term>
 
702
<listitem><simpara> the right bearing of the string.
 
703
</simpara></listitem></varlistentry>
 
704
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
 
705
<listitem><simpara> the width of the string.
 
706
</simpara></listitem></varlistentry>
 
707
<varlistentry><term><parameter>ascent</parameter>&nbsp;:</term>
 
708
<listitem><simpara> the ascent of the string.
 
709
</simpara></listitem></varlistentry>
 
710
<varlistentry><term><parameter>descent</parameter>&nbsp;:</term>
 
711
<listitem><simpara> the descent of the string.
 
712
</simpara></listitem></varlistentry>
 
713
</variablelist></refsect2>
 
714
<refsect2>
 
715
<title><anchor id="gdk-text-extents-wc" role="function" condition="deprecated:"/>gdk_text_extents_wc ()</title>
 
716
<indexterm role="deprecated"><primary>gdk_text_extents_wc</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_text_extents_wc                 (<link linkend="GdkFont">GdkFont</link> *font,
 
717
                                                         const <link linkend="GdkWChar">GdkWChar</link> *text,
 
718
                                                         <link linkend="gint">gint</link> text_length,
 
719
                                                         <link linkend="gint">gint</link> *lbearing,
 
720
                                                         <link linkend="gint">gint</link> *rbearing,
 
721
                                                         <link linkend="gint">gint</link> *width,
 
722
                                                         <link linkend="gint">gint</link> *ascent,
 
723
                                                         <link linkend="gint">gint</link> *descent);</programlisting>
 
724
<warning><para><literal>gdk_text_extents_wc</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
725
<para>
 
726
Gets the metrics of a string of wide characters.</para>
 
727
<para>
 
728
</para><variablelist role="params">
 
729
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
730
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
 
731
</simpara></listitem></varlistentry>
 
732
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
 
733
<listitem><simpara> the text to measure.
 
734
</simpara></listitem></varlistentry>
 
735
<varlistentry><term><parameter>text_length</parameter>&nbsp;:</term>
 
736
<listitem><simpara> the length of the text in character.
 
737
</simpara></listitem></varlistentry>
 
738
<varlistentry><term><parameter>lbearing</parameter>&nbsp;:</term>
 
739
<listitem><simpara> the left bearing of the string.
 
740
</simpara></listitem></varlistentry>
 
741
<varlistentry><term><parameter>rbearing</parameter>&nbsp;:</term>
 
742
<listitem><simpara> the right bearing of the string.
 
743
</simpara></listitem></varlistentry>
 
744
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
 
745
<listitem><simpara> the width of the string.
 
746
</simpara></listitem></varlistentry>
 
747
<varlistentry><term><parameter>ascent</parameter>&nbsp;:</term>
 
748
<listitem><simpara> the ascent of the string.
 
749
</simpara></listitem></varlistentry>
 
750
<varlistentry><term><parameter>descent</parameter>&nbsp;:</term>
 
751
<listitem><simpara> the descent of the string.
 
752
</simpara></listitem></varlistentry>
 
753
</variablelist></refsect2>
 
754
<refsect2>
 
755
<title><anchor id="gdk-string-width" role="function" condition="deprecated:"/>gdk_string_width ()</title>
 
756
<indexterm role="deprecated"><primary>gdk_string_width</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_string_width                    (<link linkend="GdkFont">GdkFont</link> *font,
 
757
                                                         const <link linkend="gchar">gchar</link> *string);</programlisting>
 
758
<warning><para><literal>gdk_string_width</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
759
<para>
 
760
Determines the width of a nul-terminated string.
 
761
(The distance from the origin of the string to the 
 
762
point where the next string in a sequence of strings
 
763
should be drawn)</para>
 
764
<para>
 
765
</para><variablelist role="params">
 
766
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
767
<listitem><simpara>  a <link linkend="GdkFont"><type>GdkFont</type></link>
 
768
</simpara></listitem></varlistentry>
 
769
<varlistentry><term><parameter>string</parameter>&nbsp;:</term>
 
770
<listitem><simpara> the nul-terminated string to measure
 
771
</simpara></listitem></varlistentry>
 
772
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the width of the string in pixels.
 
773
</simpara></listitem></varlistentry>
 
774
</variablelist></refsect2>
 
775
<refsect2>
 
776
<title><anchor id="gdk-text-width" role="function" condition="deprecated:"/>gdk_text_width ()</title>
 
777
<indexterm role="deprecated"><primary>gdk_text_width</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_text_width                      (<link linkend="GdkFont">GdkFont</link> *font,
 
778
                                                         const <link linkend="gchar">gchar</link> *text,
 
779
                                                         <link linkend="gint">gint</link> text_length);</programlisting>
 
780
<warning><para><literal>gdk_text_width</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
781
<para>
 
782
Determines the width of a given string.</para>
 
783
<para>
 
784
</para><variablelist role="params">
 
785
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
786
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
 
787
</simpara></listitem></varlistentry>
 
788
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
 
789
<listitem><simpara> the text to measure.
 
790
</simpara></listitem></varlistentry>
 
791
<varlistentry><term><parameter>text_length</parameter>&nbsp;:</term>
 
792
<listitem><simpara> the length of the text in bytes.
 
793
</simpara></listitem></varlistentry>
 
794
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the width of the string in pixels.
 
795
</simpara></listitem></varlistentry>
 
796
</variablelist></refsect2>
 
797
<refsect2>
 
798
<title><anchor id="gdk-text-width-wc" role="function" condition="deprecated:"/>gdk_text_width_wc ()</title>
 
799
<indexterm role="deprecated"><primary>gdk_text_width_wc</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_text_width_wc                   (<link linkend="GdkFont">GdkFont</link> *font,
 
800
                                                         const <link linkend="GdkWChar">GdkWChar</link> *text,
 
801
                                                         <link linkend="gint">gint</link> text_length);</programlisting>
 
802
<warning><para><literal>gdk_text_width_wc</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
803
<para>
 
804
Determines the width of a given wide-character string.</para>
 
805
<para>
 
806
</para><variablelist role="params">
 
807
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
808
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
 
809
</simpara></listitem></varlistentry>
 
810
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
 
811
<listitem><simpara> the text to measure.
 
812
</simpara></listitem></varlistentry>
 
813
<varlistentry><term><parameter>text_length</parameter>&nbsp;:</term>
 
814
<listitem><simpara> the length of the text in characters.
 
815
</simpara></listitem></varlistentry>
 
816
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the width of the string in pixels.
 
817
</simpara></listitem></varlistentry>
 
818
</variablelist></refsect2>
 
819
<refsect2>
 
820
<title><anchor id="gdk-char-width" role="function" condition="deprecated:Use gdk_text_extents() instead."/>gdk_char_width ()</title>
 
821
<indexterm role="deprecated"><primary>gdk_char_width</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_char_width                      (<link linkend="GdkFont">GdkFont</link> *font,
 
822
                                                         <link linkend="gchar">gchar</link> character);</programlisting>
 
823
<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>
 
824
<para>
 
825
Determines the width of a given character.</para>
 
826
<para>
 
827
</para><variablelist role="params">
 
828
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
829
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
 
830
</simpara></listitem></varlistentry>
 
831
<varlistentry><term><parameter>character</parameter>&nbsp;:</term>
 
832
<listitem><simpara> the character to measure.
 
833
</simpara></listitem></varlistentry>
 
834
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the width of the character in pixels.
 
835
 
 
836
</simpara></listitem></varlistentry>
 
837
</variablelist></refsect2>
 
838
<refsect2>
 
839
<title><anchor id="gdk-char-width-wc" role="function" condition="deprecated:"/>gdk_char_width_wc ()</title>
 
840
<indexterm role="deprecated"><primary>gdk_char_width_wc</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_char_width_wc                   (<link linkend="GdkFont">GdkFont</link> *font,
 
841
                                                         <link linkend="GdkWChar">GdkWChar</link> character);</programlisting>
 
842
<warning><para><literal>gdk_char_width_wc</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
843
<para>
 
844
Determines the width of a given wide character. (Encoded
 
845
in the wide-character encoding of the current locale).</para>
 
846
<para>
 
847
</para><variablelist role="params">
 
848
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
849
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
 
850
</simpara></listitem></varlistentry>
 
851
<varlistentry><term><parameter>character</parameter>&nbsp;:</term>
 
852
<listitem><simpara> the character to measure.
 
853
</simpara></listitem></varlistentry>
 
854
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the width of the character in pixels.
 
855
</simpara></listitem></varlistentry>
 
856
</variablelist></refsect2>
 
857
<refsect2>
 
858
<title><anchor id="gdk-string-measure" role="function" condition="deprecated:"/>gdk_string_measure ()</title>
 
859
<indexterm role="deprecated"><primary>gdk_string_measure</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_string_measure                  (<link linkend="GdkFont">GdkFont</link> *font,
 
860
                                                         const <link linkend="gchar">gchar</link> *string);</programlisting>
 
861
<warning><para><literal>gdk_string_measure</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
862
<para>
 
863
Determines the distance from the origin to the rightmost
 
864
portion of a nul-terminated string when drawn. This is not the
 
865
correct value for determining the origin of the next
 
866
portion when drawing text in multiple pieces.
 
867
See <link linkend="gdk-string-width"><function>gdk_string_width()</function></link>.</para>
 
868
<para>
 
869
</para><variablelist role="params">
 
870
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
871
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
 
872
</simpara></listitem></varlistentry>
 
873
<varlistentry><term><parameter>string</parameter>&nbsp;:</term>
 
874
<listitem><simpara> the nul-terminated string to measure.
 
875
</simpara></listitem></varlistentry>
 
876
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the right bearing of the string in pixels.
 
877
</simpara></listitem></varlistentry>
 
878
</variablelist></refsect2>
 
879
<refsect2>
 
880
<title><anchor id="gdk-text-measure" role="function" condition="deprecated:"/>gdk_text_measure ()</title>
 
881
<indexterm role="deprecated"><primary>gdk_text_measure</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_text_measure                    (<link linkend="GdkFont">GdkFont</link> *font,
 
882
                                                         const <link linkend="gchar">gchar</link> *text,
 
883
                                                         <link linkend="gint">gint</link> text_length);</programlisting>
 
884
<warning><para><literal>gdk_text_measure</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
885
<para>
 
886
Determines the distance from the origin to the rightmost
 
887
portion of a string when drawn. This is not the
 
888
correct value for determining the origin of the next
 
889
portion when drawing text in multiple pieces. 
 
890
See <link linkend="gdk-text-width"><function>gdk_text_width()</function></link>.</para>
 
891
<para>
 
892
</para><variablelist role="params">
 
893
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
894
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
 
895
</simpara></listitem></varlistentry>
 
896
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
 
897
<listitem><simpara> the text to measure.
 
898
</simpara></listitem></varlistentry>
 
899
<varlistentry><term><parameter>text_length</parameter>&nbsp;:</term>
 
900
<listitem><simpara> the length of the text in bytes.
 
901
</simpara></listitem></varlistentry>
 
902
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the right bearing of the string in pixels.
 
903
</simpara></listitem></varlistentry>
 
904
</variablelist></refsect2>
 
905
<refsect2>
 
906
<title><anchor id="gdk-char-measure" role="function" condition="deprecated:"/>gdk_char_measure ()</title>
 
907
<indexterm role="deprecated"><primary>gdk_char_measure</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_char_measure                    (<link linkend="GdkFont">GdkFont</link> *font,
 
908
                                                         <link linkend="gchar">gchar</link> character);</programlisting>
 
909
<warning><para><literal>gdk_char_measure</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
910
<para>
 
911
Determines the distance from the origin to the rightmost
 
912
portion of a character when drawn. This is not the
 
913
correct value for determining the origin of the next
 
914
portion when drawing text in multiple pieces.</para>
 
915
<para>
 
916
</para><variablelist role="params">
 
917
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
918
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
 
919
</simpara></listitem></varlistentry>
 
920
<varlistentry><term><parameter>character</parameter>&nbsp;:</term>
 
921
<listitem><simpara> the character to measure.
 
922
</simpara></listitem></varlistentry>
 
923
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the right bearing of the character in pixels.
 
924
</simpara></listitem></varlistentry>
 
925
</variablelist></refsect2>
 
926
<refsect2>
 
927
<title><anchor id="gdk-string-height" role="function" condition="deprecated:"/>gdk_string_height ()</title>
 
928
<indexterm role="deprecated"><primary>gdk_string_height</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_string_height                   (<link linkend="GdkFont">GdkFont</link> *font,
 
929
                                                         const <link linkend="gchar">gchar</link> *string);</programlisting>
 
930
<warning><para><literal>gdk_string_height</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
931
<para>
 
932
Determines the total height of a given nul-terminated
 
933
string. This value is not generally useful, because you
 
934
cannot determine how this total height will be drawn in
 
935
relation to the baseline. See <link linkend="gdk-string-extents"><function>gdk_string_extents()</function></link>.</para>
 
936
<para>
 
937
</para><variablelist role="params">
 
938
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
939
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
 
940
</simpara></listitem></varlistentry>
 
941
<varlistentry><term><parameter>string</parameter>&nbsp;:</term>
 
942
<listitem><simpara> the nul-terminated string to measure.
 
943
</simpara></listitem></varlistentry>
 
944
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the height of the string in pixels.
 
945
</simpara></listitem></varlistentry>
 
946
</variablelist></refsect2>
 
947
<refsect2>
 
948
<title><anchor id="gdk-text-height" role="function" condition="deprecated:"/>gdk_text_height ()</title>
 
949
<indexterm role="deprecated"><primary>gdk_text_height</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_text_height                     (<link linkend="GdkFont">GdkFont</link> *font,
 
950
                                                         const <link linkend="gchar">gchar</link> *text,
 
951
                                                         <link linkend="gint">gint</link> text_length);</programlisting>
 
952
<warning><para><literal>gdk_text_height</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
953
<para>
 
954
Determines the total height of a given string.
 
955
This value is not generally useful, because you cannot
 
956
determine how this total height will be drawn in
 
957
relation to the baseline. See <link linkend="gdk-text-extents"><function>gdk_text_extents()</function></link>.</para>
 
958
<para>
 
959
</para><variablelist role="params">
 
960
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
961
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
 
962
</simpara></listitem></varlistentry>
 
963
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
 
964
<listitem><simpara> the text to measure.
 
965
</simpara></listitem></varlistentry>
 
966
<varlistentry><term><parameter>text_length</parameter>&nbsp;:</term>
 
967
<listitem><simpara> the length of the text in bytes.
 
968
</simpara></listitem></varlistentry>
 
969
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the height of the string in pixels.
 
970
</simpara></listitem></varlistentry>
 
971
</variablelist></refsect2>
 
972
<refsect2>
 
973
<title><anchor id="gdk-char-height" role="function" condition="deprecated:Use gdk_text_extents() instead."/>gdk_char_height ()</title>
 
974
<indexterm role="deprecated"><primary>gdk_char_height</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_char_height                     (<link linkend="GdkFont">GdkFont</link> *font,
 
975
                                                         <link linkend="gchar">gchar</link> character);</programlisting>
 
976
<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>
 
977
<para>
 
978
Determines the total height of a given character.
 
979
This value is not generally useful, because you cannot
 
980
determine how this total height will be drawn in
 
981
relation to the baseline. See <link linkend="gdk-text-extents"><function>gdk_text_extents()</function></link>.</para>
 
982
<para>
 
983
</para><variablelist role="params">
 
984
<varlistentry><term><parameter>font</parameter>&nbsp;:</term>
 
985
<listitem><simpara> a <link linkend="GdkFont"><type>GdkFont</type></link>
 
986
</simpara></listitem></varlistentry>
 
987
<varlistentry><term><parameter>character</parameter>&nbsp;:</term>
 
988
<listitem><simpara> the character to measure.
 
989
</simpara></listitem></varlistentry>
 
990
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the height of the character in pixels.
 
991
 
 
992
</simpara></listitem></varlistentry>
 
993
</variablelist></refsect2>
 
994
<refsect2>
 
995
<title><anchor id="GdkWChar" role="typedef"/>GdkWChar</title>
 
996
<indexterm><primary>GdkWChar</primary></indexterm><programlisting>typedef guint32                           GdkWChar;
 
997
</programlisting>
 
998
<para>
 
999
Specifies a wide character type, used to represent character codes.
 
1000
This is needed since some native languages have character sets which have
 
1001
more than 256 characters (Japanese and Chinese, for example).
 
1002
</para>
 
1003
<para>
 
1004
Wide character values between 0 and 127 are always identical in meaning to
 
1005
the ASCII character codes. The wide character value 0 is often used to
 
1006
terminate strings of wide characters in a similar way to normal strings
 
1007
using the char type.
 
1008
</para>
 
1009
<para>
 
1010
An alternative to wide characters is multi-byte characters, which extend
 
1011
normal char strings to cope with larger character sets. As the name suggests,
 
1012
multi-byte characters use a different number of bytes to store different
 
1013
character codes. For example codes 0-127 (i.e. the ASCII codes) often
 
1014
use just one byte of memory, while other codes may use 2, 3 or even 4 bytes.
 
1015
Multi-byte characters have the advantage that they can often be used in an
 
1016
application with little change, since strings are still represented as arrays
 
1017
of char values. However multi-byte strings are much easier to manipulate since
 
1018
the character are all of the same size.
 
1019
</para>
 
1020
<para>
 
1021
Applications typically use wide characters to represent character codes
 
1022
internally, and multi-byte strings when saving the characters to a file.
 
1023
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
 
1024
one representation to the other.
 
1025
</para>
 
1026
<para>
 
1027
See the 'Extended Characters' section of the GNU C Library Reference Manual
 
1028
for more detailed information on wide and multi-byte characters.
 
1029
</para></refsect2>
 
1030
<refsect2>
 
1031
<title><anchor id="gdk-wcstombs" role="function" condition="deprecated:"/>gdk_wcstombs ()</title>
 
1032
<indexterm role="deprecated"><primary>gdk_wcstombs</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*              gdk_wcstombs                        (const <link linkend="GdkWChar">GdkWChar</link> *src);</programlisting>
 
1033
<warning><para><literal>gdk_wcstombs</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
1034
<para>
 
1035
Converts a wide character string to a multi-byte string.
 
1036
(The function name comes from an acronym of 'Wide Character String TO
 
1037
Multi-Byte String').</para>
 
1038
<para>
 
1039
</para><variablelist role="params">
 
1040
<varlistentry><term><parameter>src</parameter>&nbsp;:</term>
 
1041
<listitem><simpara> a wide character string.
 
1042
</simpara></listitem></varlistentry>
 
1043
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the multi-byte string corresponding to <parameter>src</parameter>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the
 
1044
conversion failed. The returned string should be freed with <link linkend="g-free"><function>g_free()</function></link> when no
 
1045
longer needed.
 
1046
</simpara></listitem></varlistentry>
 
1047
</variablelist></refsect2>
 
1048
<refsect2>
 
1049
<title><anchor id="gdk-mbstowcs" role="function" condition="deprecated:"/>gdk_mbstowcs ()</title>
 
1050
<indexterm role="deprecated"><primary>gdk_mbstowcs</primary></indexterm><programlisting><link linkend="gint">gint</link>                gdk_mbstowcs                        (<link linkend="GdkWChar">GdkWChar</link> *dest,
 
1051
                                                         const <link linkend="gchar">gchar</link> *src,
 
1052
                                                         <link linkend="gint">gint</link> dest_max);</programlisting>
 
1053
<warning><para><literal>gdk_mbstowcs</literal> is deprecated and should not be used in newly-written code.</para></warning>
 
1054
<para>
 
1055
Converts a multi-byte string to a wide character string.
 
1056
(The function name comes from an acronym of 'Multi-Byte String TO Wide
 
1057
Character String').</para>
 
1058
<para>
 
1059
</para><variablelist role="params">
 
1060
<varlistentry><term><parameter>dest</parameter>&nbsp;:</term>
 
1061
<listitem><simpara> the space to place the converted wide character string into.
 
1062
</simpara></listitem></varlistentry>
 
1063
<varlistentry><term><parameter>src</parameter>&nbsp;:</term>
 
1064
<listitem><simpara> the multi-byte string to convert, which must be nul-terminated.
 
1065
</simpara></listitem></varlistentry>
 
1066
<varlistentry><term><parameter>dest_max</parameter>&nbsp;:</term>
 
1067
<listitem><simpara> the maximum number of wide characters to place in <parameter>dest</parameter>.
 
1068
</simpara></listitem></varlistentry>
 
1069
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the number of wide characters written into <parameter>dest</parameter>, or -1 if 
 
1070
  the conversion failed.
 
1071
</simpara></listitem></varlistentry>
 
1072
</variablelist></refsect2>
 
1073
 
 
1074
</refsect1>
 
1075
 
 
1076
 
 
1077
 
 
1078
 
 
1079
</refentry>