Sophie

Sophie

distrib > Fedora > 13 > i386 > media > os > by-pkgid > b8240933842cee58f4e7ce03017867c5 > files > 10

libsx-devel-2.05-18.fc12.i686.rpm

<title> Fonts </title>

<ul>
 <li> <a href="#fonts"> Fonts </a>
 <li> <a href="font.html#fFH">  FontHeight </a>
 <li> <a href="font.html#fFF">  FreeFont </a>
 <li> <a href="font.html#fGF">  GetFont </a>
 <li> <a href="font.html#fGWF"> GetWidgetFont </a>
 <li> <a href="font.html#fSWF"> SetWidgetFont </a>
 <li> <a href="font.html#fTW">  TextWidth </a>
</ul>
<hr>
<p>
<h2> <a name="fonts"> Fonts </a> </h2>
<p>
Fonts are different type styles that can be used in various widgets.
You load a font by name and get a handle in return. The handle you get
allows you to set the font in the various widgets and font information
calls. 
<hr>
<p>
<a name="fGF"> <b>
XFont GetFont(char *fontname);
</b> </a>
<p>
This function loads the font named by fontname and returns a handle to
the font or NULL if there is an error.  The handle returned by this
function is an XFontStruct pointer, but should be treated as an opaque
data type.
<p>
After you've loaded a font, you can then set that font in any widget
that displays text.  You can also use the handle in calls to
TextWidget() 
and 
<a href="font.html#fFH">          FontHeight() </a>.
<p>
When you are done with a font, you should free it with 
<a href="font.html#fFF">          FreeFont() </a>. 
<p>
SEE ALSO: 
<a href="font.html#fSWF">         SetWidgetFont() </a>, 
<a href="font.html#fFF">          FreeFont() </a>, 
<a href="font.html#fGWF">         GetWidgetFont() </a>,
<a href="font.html#fFH">          FontHeight() </a>, 
<a href="font.html#fTW">          TextWidth() </a>
<hr>
<p>
<a name="fSWF"> <b>
void  SetWidgetFont(Widget w, XFont f);
</b> </a>
<p>
This functions sets the font used by the widget `w', to be the font
referred to by the argument `f'.  The argument f should have been
obtained with 
<a href="font.html#fGF">          GetFont() </a>.
<p>
SEE ALSO: 
<a href="font.html#fGF">          GetFont() </a>, 
<a href="font.html#fFF">          FreeFont() </a>, 
<a href="font.html#fFH">          FontHeight() </a>, 
<a href="font.html#fTW">          TextWidth() </a>
<hr>
<p>
<a name="fGWF"> <b>
XFont  GetWidgetFont(Widget w);
</b> </a>
<p>
This function returns a handle to the font currently used by the
Widget w.  If an error occurs or there is no default font for the
widget, a NULL is returned.
<p>
You should NOT call FreeFont() on any value returned by this function
unless you are sure that you allocated the font with GetFont().
<p>
SEE ALSO: 
<a href="font.html#fGF">          GetFont() </a>, 
<a href="font.html#fSWF">         SetWidgetFont() </a>, 
<a href="font.html#fFH">          FontHeight() </a>, 
<a href="font.html#fTW">          TextWidth() </a>
<hr>
<p>
<a name="fFF"> <b>
void  FreeFont(XFont f);
</b> </a>
<p>
This function frees the resources associated with the font, f.  You
should call this function when your application is done using a
particular font.
<p>
Of course you should make sure that no widget still uses the
identified font.
<p>
SEE ALSO: 
<a href="font.html#fSWF">         SetWidgetFont() </a>, 
<a href="font.html#fGF">          GetFont() </a>
<hr>
<p>
<a name="fFH"> <b>
int   FontHeight(XFont f);
</b> </a>
<p>
This function returns an integer value that is the height in pixels of
the specified font.   The height is defined to be the ascent of the
characters (from the baseline to the top of a capital letter) plus the
descent of the characters (the distance from the baseline to bottom of
a descender character like `g' or `p'). 
<p>
SEE ALSO: 
<a href="font.html#fTW">          TextWidth() </a>, 
<a href="font.html#fGF">          GetFont() </a>, 
<a href="font.html#fSWF">         SetWidgetFont() </a>
<hr>
<p>
<a name="fTW"> <b>
int   TextWidth(XFont f, char *txt);
</b> </a>
<p>
This functions returns the width in pixels used by the string pointed
to by txt in the font f.  The string should be null-terminated and the
entire string is used to determine the width.
<p>
SEE ALSO: 
<a href="font.html#fFH">          FontHeight() </a>, 
<a href="font.html#fGF">          GetFont() </a>, 
<a href="font.html#fGWF">         GetWidgetFont() </a>