1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
Fonts
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2001-02-12 17:50:13 +00:00
|
|
|
loading and manipulating fonts
|
1999-08-16 18:51:52 +00:00
|
|
|
|
2000-12-12 07:32:32 +00:00
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
1999-08-16 18:51:52 +00:00
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
The #GdkFont data type represents a font for drawing on
|
2001-02-12 17:50:13 +00:00
|
|
|
the screen. These functions provide support for
|
|
|
|
loading fonts, and also for determining the dimensions
|
|
|
|
of characters and strings when drawn with a particular
|
|
|
|
font.
|
|
|
|
</para>
|
1999-08-16 18:51:52 +00:00
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
<para>
|
|
|
|
Fonts in X are specified by a
|
|
|
|
<firstterm>X Logical Font Description</firstterm>.
|
|
|
|
The following description is considerably simplified.
|
|
|
|
For definitive information about XLFD's see the
|
|
|
|
X reference documentation. A X Logical Font Description (XLFD)
|
|
|
|
consists of a sequence of fields separated (and surrounded by) '-'
|
|
|
|
characters. For example, Adobe Helvetica Bold 12 pt, has the
|
|
|
|
full description:
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
<informalexample><programlisting>
|
2001-02-12 17:50:13 +00:00
|
|
|
"-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1"
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
</programlisting></informalexample>
|
2001-02-12 17:50:13 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The fields in the XLFD are:
|
|
|
|
|
|
|
|
<informaltable pgwide=1 frame="none">
|
|
|
|
<tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*">
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry>Foundry</entry>
|
|
|
|
<entry>the company or organization where the font originated.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry>Family</entry>
|
|
|
|
<entry>the font family (a group of related font designs).</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry>Weight</entry>
|
|
|
|
<entry>A name for the font's typographic weight
|
|
|
|
For example, 'bold' or 'medium').</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry>Slant</entry>
|
|
|
|
<entry>The slant of the font. Common values are 'R' for Roman,
|
|
|
|
'I' for italoc, and 'O' for oblique.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry>Set Width</entry>
|
|
|
|
<entry>A name for the width of the font. For example,
|
|
|
|
'normal' or 'condensed'.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry>Add Style</entry>
|
|
|
|
<entry>Additional information to distinguish a font from
|
|
|
|
other fonts of the same family.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry>Pixel Size</entry>
|
|
|
|
<entry>The body size of the font in pixels.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry>Point Size</entry>
|
|
|
|
<entry>The body size of the font in 10ths of a point.
|
|
|
|
(A <firstterm>point</firstterm> is 1/72.27 inch) </entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry>Resolution X</entry>
|
|
|
|
<entry>The horizontal resolution that the font was designed for.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry>Resolution Y</entry>
|
|
|
|
<entry>The vertical resolution that the font was designed for .</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry>Spacing</entry>
|
|
|
|
<entry>The type of spacing for the font - can be 'p' for proportional,
|
|
|
|
'm' for monospaced or 'c' for charcell.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry>Average Width</entry>
|
|
|
|
<entry>The average width of a glyph in the font. For monospaced
|
|
|
|
and charcell fonts, all glyphs in the font have this width</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry>Charset Registry</entry>
|
|
|
|
<entry>The registration authority that owns the encoding for
|
|
|
|
the font. Together with the Charset Encoding field, this
|
|
|
|
defines the character set for the font.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry>Charset Encoding</entry>
|
|
|
|
<entry>An identifier for the particular character set encoding.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody></tgroup></informaltable>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
When specifying a font via a X logical Font Description,
|
|
|
|
'*' can be used as a wildcard to match any portion of
|
|
|
|
the XLFD. For instance, the above example could
|
|
|
|
also be specified as
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
<informalexample><programlisting>
|
2001-02-12 17:50:13 +00:00
|
|
|
"-*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1"
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
</programlisting></informalexample>
|
2001-02-12 17:50:13 +00:00
|
|
|
|
|
|
|
It is generally a good idea to use wildcards for any
|
|
|
|
portion of the XLFD that your program does not care
|
|
|
|
about specifically, since that will improve the
|
|
|
|
chances of finding a matching font.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
A <firstterm>fontset</firstterm> is a list of fonts
|
|
|
|
that is used for drawing international text that may
|
|
|
|
contain characters from a number of different character
|
|
|
|
sets. It is represented by a list of XLFD's.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The font for a given character set is determined by going
|
|
|
|
through the list of XLFD's in order. For each one, if
|
|
|
|
the registry and and encoding fields match the desired
|
|
|
|
character set, then that font is used, otherwise if
|
|
|
|
the XLFD contains wild-cards for the registry and encoding
|
|
|
|
fields, the registry and encoding for the desired character
|
2001-11-28 23:41:12 +00:00
|
|
|
set are substituted in and a lookup is done. If a match is found
|
2001-02-12 17:50:13 +00:00
|
|
|
that font is used. Otherwise, processing continues
|
|
|
|
on to the next font in the list.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The functions for determining the metrics of a string
|
|
|
|
come in several varieties that can take a number
|
|
|
|
of forms of string input:
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>8-bit string</term>
|
|
|
|
<listitem><para>
|
|
|
|
When using functions like gdk_string_width() that
|
|
|
|
take a <type>gchar *</type>, if the font is of type
|
|
|
|
%GDK_FONT_FONT and is an 8-bit font, then each
|
|
|
|
<type>gchar</type> indexes the glyphs in the font directly.
|
|
|
|
</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>16-bit string</term>
|
|
|
|
<listitem><para>
|
|
|
|
For functions taking a <type>gchar *</type>, if the
|
|
|
|
font is of type %GDK_FONT_FONT, and is a 16-bit
|
|
|
|
font, then the <type>gchar *</type> argument is
|
|
|
|
interpreted as a <type>guint16 *</type> cast to
|
|
|
|
a <type>gchar *</type> and each <type>guint16</type>
|
|
|
|
indexes the glyphs in the font directly.
|
|
|
|
</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>Multibyte string</term>
|
|
|
|
<listitem><para>
|
|
|
|
For functions taking a <type>gchar *</type>, if the
|
|
|
|
font is of type %GDK_FONT_FONTSET, then the input
|
|
|
|
string is interpreted as a <firstterm>multibyte</firstterm>
|
|
|
|
encoded according to the current locale. (A multibyte
|
|
|
|
string is one in which each character may consist
|
|
|
|
of one or more bytes, with different lengths for different
|
|
|
|
characters in the string). They can be converted to and
|
|
|
|
from wide character strings (see below) using
|
|
|
|
gdk_wcstombs() and gdk_mbstowcs().) The string will
|
|
|
|
be rendered using one or more different fonts from
|
|
|
|
the fontset.
|
|
|
|
</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>Wide character string</term>
|
|
|
|
<listitem><para>
|
2001-11-28 23:41:12 +00:00
|
|
|
For a number of the text-measuring functions, GDK
|
2001-02-12 17:50:13 +00:00
|
|
|
provides a variant (such as gdk_text_width_wc()) which
|
|
|
|
takes a <type>GdkWChar *</type> instead of a
|
|
|
|
<type>gchar *</type>. The input is then taken to
|
|
|
|
be a wide character string in the encoding of the
|
|
|
|
current locale. (A wide character string is a string
|
|
|
|
in which each character consists of several bytes,
|
|
|
|
and the width of each character in the string is
|
|
|
|
constant.)
|
|
|
|
</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
GDK provides functions to determine a number of different
|
|
|
|
measurements (metrics) for a given string. (Need diagram
|
|
|
|
here).
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>ascent</term>
|
|
|
|
<listitem><para>
|
|
|
|
The vertical distance from the origin of the drawing
|
|
|
|
opereration to the top of the drawn character.
|
|
|
|
</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>descent</term>
|
|
|
|
<listitem><para>
|
|
|
|
The vertical distance from the origin of the drawing
|
|
|
|
opereration to the bottom of the drawn character.
|
|
|
|
</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>left bearing</term>
|
|
|
|
<listitem><para>
|
|
|
|
The horizontal distance from the origin of the drawing
|
|
|
|
operation to the left-most part of the drawn character.
|
|
|
|
</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>right bearing</term>
|
|
|
|
<listitem><para>
|
|
|
|
The horizontal distance from the origin of the drawing
|
|
|
|
operation to the right-most part of the drawn character.
|
|
|
|
</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>width bearing</term>
|
|
|
|
<listitem><para>
|
|
|
|
The horizontal distance from the origin of the drawing
|
|
|
|
operation to the correct origin for drawing another
|
|
|
|
string to follow the current one. Depending on the
|
|
|
|
font, this could be greater than or less than the
|
|
|
|
right bearing.
|
|
|
|
</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### STRUCT GdkFont ##### -->
|
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
The <structname>GdkFont</structname> structure represents a font or fontset. It
|
|
|
|
contains the following public fields. A new <structname>GdkFont</structname>
|
2001-02-12 17:50:13 +00:00
|
|
|
structure is returned by gdk_font_load() or gdk_fontset_load(),
|
|
|
|
and is reference counted with gdk_font_ref() and gdk_font_unref()
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-11-28 23:41:12 +00:00
|
|
|
@type: a value of type #GdkFontType which indicates
|
|
|
|
whether this font is a single font or a fontset.
|
|
|
|
@ascent: the maximum distance that the font, when drawn,
|
|
|
|
ascends above the baseline.
|
|
|
|
@descent: the maximum distance that the font, when drawn,
|
|
|
|
descends below the baseline.
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### ENUM GdkFontType ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Indicates the type of a font. The possible values
|
|
|
|
are currently:
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-11-28 23:41:12 +00:00
|
|
|
@GDK_FONT_FONT: the font is a single font.
|
|
|
|
@GDK_FONT_FONTSET: the font is a fontset.
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### FUNCTION gdk_font_load ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Loads a font.
|
|
|
|
</para>
|
1999-08-16 18:51:52 +00:00
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
The font may be newly loaded or looked up the font in a cache.
|
|
|
|
You should make no assumptions about the initial reference count.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font_name: a XLFD describing the font to load.
|
2001-11-28 23:41:12 +00:00
|
|
|
@Returns: a #GdkFont, or %NULL if the font could not be loaded.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2002-04-30 18:07:51 +00:00
|
|
|
<!-- ##### FUNCTION gdk_font_load_for_display ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@display:
|
|
|
|
@font_name:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### FUNCTION gdk_fontset_load ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Loads a fontset.
|
|
|
|
</para>
|
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
The fontset may be newly loaded or looked up in a cache.
|
|
|
|
You should make no assumptions about the initial reference count.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@fontset_name: a comma-separated list of XLFDs describing
|
|
|
|
the component fonts of the fontset to load.
|
2001-11-28 23:41:12 +00:00
|
|
|
@Returns: a #GdkFont, or %NULL if the fontset could not be loaded.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2002-04-30 18:07:51 +00:00
|
|
|
<!-- ##### FUNCTION gdk_fontset_load_for_display ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@display:
|
|
|
|
@fontset_name:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
<!-- ##### FUNCTION gdk_font_from_description ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@font_desc:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2002-04-30 18:07:51 +00:00
|
|
|
<!-- ##### FUNCTION gdk_font_from_description_for_display ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@display:
|
|
|
|
@font_desc:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_font_get_display ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@font:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### FUNCTION gdk_font_ref ##### -->
|
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
Increases the reference count of a font by one.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
|
|
|
@Returns: @font
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_font_unref ##### -->
|
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
Decreases the reference count of a font by one.
|
2001-02-12 17:50:13 +00:00
|
|
|
If the result is zero, destroys the font.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_font_id ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Returns the X Font ID for the given font.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont.
|
|
|
|
@Returns: the numeric X Font ID
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_font_equal ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
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.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@fonta: a #GdkFont.
|
|
|
|
@fontb: another #GdkFont.
|
|
|
|
@Returns: %TRUE if the fonts are equal.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_string_extents ##### -->
|
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
Returns the metrics of a nul-terminated string.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont.
|
2001-11-28 23:41:12 +00:00
|
|
|
@string: the nul-terminated string to measure.
|
2001-02-12 17:50:13 +00:00
|
|
|
@lbearing: the left bearing of the string.
|
|
|
|
@rbearing: the right bearing of the string.
|
|
|
|
@width: the width of the string.
|
|
|
|
@ascent: the ascent of the string.
|
|
|
|
@descent: the descent of the string.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_text_extents ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Returns the metrics of a string.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
|
|
|
@text: the text to measure
|
|
|
|
@text_length: 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.)
|
|
|
|
@lbearing: the left bearing of the string.
|
|
|
|
@rbearing: the right bearing of the string.
|
|
|
|
@width: the width of the string.
|
|
|
|
@ascent: the ascent of the string.
|
|
|
|
@descent: the descent of the string.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_text_extents_wc ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Returns the metrics of a string of wide characters.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
|
|
|
@text: the text to measure.
|
|
|
|
@text_length: the length of the text in character.
|
|
|
|
@lbearing: the left bearing of the string.
|
|
|
|
@rbearing: the right bearing of the string.
|
|
|
|
@width: the width of the string.
|
|
|
|
@ascent: the ascent of the string.
|
|
|
|
@descent: the descent of the string.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_string_width ##### -->
|
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
Determines the width of a nul-terminated string.
|
2001-02-12 17:50:13 +00:00
|
|
|
(The distance from the origin of the string to the
|
|
|
|
point where the next string in a sequence of strings
|
|
|
|
should be drawn)
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
2001-11-28 23:41:12 +00:00
|
|
|
@string: the nul-terminated string to measure
|
2001-02-12 17:50:13 +00:00
|
|
|
@Returns: the width of the string in pixels.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_text_width ##### -->
|
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
Determines the width of a given string.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
|
|
|
@text: the text to measure.
|
|
|
|
@text_length: the length of the text in bytes.
|
|
|
|
@Returns: the width of the string in pixels.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_text_width_wc ##### -->
|
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
Determines the width of a given wide-character string.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
|
|
|
@text: the text to measure.
|
|
|
|
@text_length: the length of the text in characters.
|
|
|
|
@Returns: the width of the string in pixels.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_char_width ##### -->
|
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
Determines the width of a given character.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
|
|
|
@character: the character to measure.
|
|
|
|
@Returns: the width of the character in pixels.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_char_width_wc ##### -->
|
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
Determines the width of a given wide character. (Encoded
|
2001-02-12 17:50:13 +00:00
|
|
|
in the wide-character encoding of the current locale).
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
|
|
|
@character: the character to measure.
|
|
|
|
@Returns: the width of the character in pixels.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_string_measure ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Determines the distance from the origin to the rightmost
|
2001-11-28 23:41:12 +00:00
|
|
|
portion of a nul-terminated string when drawn. This is not the
|
2001-02-12 17:50:13 +00:00
|
|
|
correct value for determining the origin of the next
|
|
|
|
portion when drawing text in multiple pieces.
|
|
|
|
See gdk_string_width().
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
2001-11-28 23:41:12 +00:00
|
|
|
@string: the nul-terminated string to measure.
|
2001-02-12 17:50:13 +00:00
|
|
|
@Returns: the right bearing of the string in pixels.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_text_measure ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
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 gdk_text_width().
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
|
|
|
@text: the text to measure.
|
|
|
|
@text_length: the length of the text in bytes.
|
|
|
|
@Returns: the right bearing of the string in pixels.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_char_measure ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
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.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
|
|
|
@character: the character to measure.
|
|
|
|
@Returns: the right bearing of the character in pixels.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_string_height ##### -->
|
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
Determines the total height of a given nul-terminated
|
2001-02-12 17:50:13 +00:00
|
|
|
string. This value is not generally useful, because you
|
|
|
|
cannot determine how this total height will be drawn in
|
|
|
|
relation to the baseline. See gdk_string_extents().
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
2001-11-28 23:41:12 +00:00
|
|
|
@string: the nul-terminated string to measure.
|
2001-02-12 17:50:13 +00:00
|
|
|
@Returns: the height of the string in pixels.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_text_height ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
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 gdk_text_extents().
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
|
|
|
@text: the text to measure.
|
|
|
|
@text_length: the length of the text in bytes.
|
|
|
|
@Returns: the height of the string in pixels.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_char_height ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
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 gdk_text_extents().
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@font: a #GdkFont
|
|
|
|
@character: the character to measure.
|
|
|
|
@Returns: the height of the character in pixels.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
<!-- ##### FUNCTION gdk_font_full_name_get ##### -->
|
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
Returns a comma-separated list of XLFDs for the
|
|
|
|
fonts making up a given #GdkFont.
|
2000-09-07 18:17:06 +00:00
|
|
|
</para>
|
|
|
|
|
2001-11-28 23:41:12 +00:00
|
|
|
@font: a #GdkFont
|
|
|
|
@Returns: a newly-allocated string containing a list of XLFDs,
|
|
|
|
should be freed with gdk_font_full_name_free() when no longer needed.
|
2000-09-07 18:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_font_full_name_free ##### -->
|
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
Frees a full font name obtained from gdk_font_full_name_get().
|
2000-09-07 18:17:06 +00:00
|
|
|
</para>
|
|
|
|
|
2001-11-28 23:41:12 +00:00
|
|
|
@name: a full font name.
|
2000-09-07 18:17:06 +00:00
|
|
|
|
|
|
|
|
2000-02-01 04:27:56 +00:00
|
|
|
<!-- ##### TYPEDEF GdkWChar ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Specifies a wide character type, used to represent character codes.
|
|
|
|
This is needed since some native languages have character sets which have
|
|
|
|
more than 256 characters (Japanese and Chinese, for example).
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Wide character values between 0 and 127 are always identical in meaning to
|
|
|
|
the ASCII character codes. The wide character value 0 is often used to
|
|
|
|
terminate strings of wide characters in a similar way to normal strings
|
|
|
|
using the char type.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
An alternative to wide characters is multi-byte characters, which extend
|
|
|
|
normal char strings to cope with larger character sets. As the name suggests,
|
|
|
|
multi-byte characters use a different number of bytes to store different
|
|
|
|
character codes. For example codes 0-127 (i.e. the ASCII codes) often
|
|
|
|
use just one byte of memory, while other codes may use 2, 3 or even 4 bytes.
|
|
|
|
Multi-byte characters have the advantage that they can often be used in an
|
|
|
|
application with little change, since strings are still represented as arrays
|
|
|
|
of char values. However multi-byte strings are much easier to manipulate since
|
|
|
|
the character are all of the same size.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Applications typically use wide characters to represent character codes
|
|
|
|
internally, and multi-byte strings when saving the characters to a file.
|
|
|
|
The gdk_wcstombs() and gdk_mbstowcs() functions can be used to convert from
|
|
|
|
one representation to the other.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
See the 'Extended Characters' section of the GNU C Library Reference Manual
|
|
|
|
for more detailed information on wide and multi-byte characters.
|
2000-02-01 04:27:56 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_wcstombs ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
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').
|
2000-02-01 04:27:56 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@src: a wide character string.
|
2001-11-28 23:41:12 +00:00
|
|
|
@Returns: the multi-byte string corresponding to @src, or %NULL if the
|
2001-02-12 17:50:13 +00:00
|
|
|
conversion failed. The returned string should be freed with g_free() when no
|
|
|
|
longer needed.
|
2000-02-01 04:27:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_mbstowcs ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
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').
|
2000-02-01 04:27:56 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@dest: the space to place the converted wide character string into.
|
2001-11-28 23:41:12 +00:00
|
|
|
@src: the multi-byte string to convert, which must be nul-terminated.
|
2001-02-12 17:50:13 +00:00
|
|
|
@dest_max: the maximum number of wide characters to place in @dest.
|
|
|
|
@Returns: the number of wide characters written into @dest, or -1 if the
|
|
|
|
conversion failed.
|
2000-02-01 04:27:56 +00:00
|
|
|
|
|
|
|
|