You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_Font object:
Cvo_Font
#include
<Cvo/Font.h++>
Cvo_Font c( )
Cvo_Font c( Cvo_Object *object )
Cvo_Font c( Cvo_BasicObject *object,
char *name )
Cvo_Font c( Cvo_BasicObject *object,
XrmQuark name )
Cvo_Font c( Cvo_DisplayList *display,
char *name )
Cvo_Font c( Cvo_Font old_font )
The Cvo_Font object is used to store fonts in Cvo. A font can be created in one of several ways, as shown above. When a font is created with no arguments it starts in the empty state, which means none of its member functions will actually work. Typically it is created with either a set of the arguments shown above, or it is assigned the value of another Cvo_Font object.
A Cvo_Font must be associated with a display, typically this is done by simply passing a Cvo_Object as object, though there is a constructor for using a Cvo_DisplayList directly. In each case, name refers to the font to be loaded. If name is not present then the standard font resources will be used to determine what font to load for that window.
If old_font is passed, this object will become a copy of it.
This object defines the following member functions.
The Cvo_Font object is a smart pointer. This means that the Cvo_Font
object actually indirectly accesses the data associated with it.
This allows many Cvo_Font objects to actually refer to the same font
value. Due to this, the Cvo_Font object has a somewhat unique method
of accessing most of its member functions. All the functions listed
below assume the name of the Cvo_Font object is c
. Note that
c
is not a pointer to a Cvo_Font object, but the Cvo_Font
object itself.
BOOL c.Empty (
)
BOOL c.Full (
)
These functions return a True
or False
value, indicating
whether or not the font has been allocated or not.
XFontSet Fontset (
)
Only defined for X11R5 and higher systems, this function returns
the XFontSet
associated with a font.
int Width (
)
int Height (
)
Return the maximum width/height of any character in the font.
int Ascent (
)
int Descent (
)
Return the maximum ascent/descent of any character in the font.
int MWidth (
)
int MHeight (
)
Return the average width/height of the alphabetic characters in the font.
See the example source code for an example of how to use this object.
See the legend for information about the conventions used in this documentation.