pfFont(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages pfFont(3pf)NAMEpfFont - Routines to load fonts for use in Performer.
FUNCTION SPECIFICATION
#include <Performer/pr/pfString.h>
pfFont::pfFont()
static pfType* pfFont::getClassType(void);
void pfFont::setCharGSet(int ascii, pfGeoSet *gset);
pfGeoSet* pfFont::getCharGSet(int ascii);
void pfFont::setCharSpacing(int ascii, pfVec3 &spacing);
const pfVec3& pfFont::getCharSpacing(int ascii);
void pfFont::setAttr(int which, void *attr);
void* pfFont::getAttr(int which);
void pfFont::setVal(int which, float val);
float pfFont::getVal(int which);
void pfFont::setMode(int mode, int val);
int pfFont::getMode(int mode);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfFont is derived from the parent class
pfObject, so each of these member functions of class pfObject are also
directly usable with objects of class pfFont. This is also true for
ancestor classes of class pfObject.
void* pfObject::operator new(size_t);
void* pfObject::operator new(size_t, void *arena);
void* pfObject::operator new(size_t, pfFluxMemory *fmem);
void pfObject::setUserData(void *data);
void pfObject::setUserData(int slot, void *data);
void* pfObject::getUserData(pfObject *obj);
void* pfObject::getUserData(pfObject *obj, int slot);
int pfObject::getNumUserData();
Since the class pfObject is itself derived from the parent class
pfMemory, objects of class pfFont can also be used with these functions
designed for objects of class pfMemory.
Page 1
pfFont(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages pfFont(3pf)
void* pfMemory::getData(const void *ptr);
pfType * pfMemory::getType();
int pfMemory::isOfType(pfType *type);
int pfMemory::isExactType(pfType *type);
const char * pfMemory::getTypeName();
int pfMemory::copy(pfMemory *src);
int pfMemory::compare(const pfMemory *mem);
void pfMemory::print(uint which, uint verbose, char *prefix,
FILE *file);
int pfMemory::getArena(void *ptr);
void* pfMemory::getArena();
int pfMemory::ref();
int pfMemory::unref();
int pfMemory::unrefDelete();
int pfMemory::unrefGetRef();
int pfMemory::getRef();
int pfMemory::checkDelete();
int pfMemory::isFluxed();
void * pfMemory::getArena();
int pfMemory::getSize();
DESCRIPTION
The pfFont facility provides the capability to load fonts for 3-D
rendering with the string drawing routines from pfString and pfText. The
basic methodology is the user provides individual GeoSets to be used as
font characters. Likewise, the user provides 3-D spacings for each
character so that Performer can correctly move the 'cursor' or '3-D
origin' after drawing each character. Note that this facility is
completely general and is independent of external font descriptions - see
pfdLoadFont for a description of loading some PostScript Type I fonts
into a pfFont structure.
new(arena) allocates a pfFont from the specified memory arena, or from
the process heap if arena is NULL. new allocates a pfFont from the
default memory arena (see pfGetSharedArena). Like other pfObjects,
pfFonts cannot be created statically, automatically on the stack or in
arrays and should be deleted with pfDelete rather than the delete
operator.
pfFont::getClassType returns the pfType* for the class pfFont. The
pfType* returned by pfFont::getClassType is the same as the pfType*
returned by invoking the virtual function getType on any instance of
class pfFont. Because OpenGL Performer allows subclassing of built-in
types, when decisions are made based on the type of an object, it is
usually better to use the member function isOfType to test if an object
is of a type derived from a Performer type rather than to test for strict
equality of the pfType*'s.
pfFont Definition:
Call pfFont::setCharGSet to set the pfGeoSet which Performer should use
when drawing the character specified by ascii in a pfString.
Page 2
pfFont(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages pfFont(3pf)
pfFont::getCharGSet returns the pfGeoSet currently being used for the
character specified by ascii. Call pfFont::setCharSpacing to set the 3D
spacing for the character specified by ascii to be the pfVec3 spacing.
This spacing is used to update the cursor position of a pfString after
this character has been drawn. pfFont::getCharSpacing returns a
reference to a pfVec3 specifying the spacing of a given character of a
font.
pfFont Attributes:
pfFont::setAttr sets a particular attribute for a given Performer font,
while pfFont::getAttr will return a particular attribute corresponding to
the which token.
Current valid pfFont Attributes: PFFONT_GSTATE PFFONT_BBOX
PFFONT_SPACING PFFONT_NAME
PFFONT_GSTATE specifies a global pfGeoState to be used for every
character of a pfFont. Note that pfGeoStates bound to GeoSets
representing characters will take precedence over the PFFONT_GSTATE
pfGeoState. A Font has NO pfGeoState by default.
PFFONT_BBOX specifies a bounding box that will enclose every individual
character of a pfFont.
PFFONT_SPACING specifies a global spacing to use to simulate fixed width
fonts. This spacing is used only if the pfFont mode PFFONT_CHAR_SPACING
is set to PFFONT_CHAR_SPACING_FIXED or a spacing is not available (NULL)
for a given character. PFFONT_NAME simply specifies a name associated
with a pfFont.
pfFont Modes:
pfFont::setMode sets a particular mode for a given Performer font, while
pfFont::getAttr will return the current value of the mode corresponding
to the mode token.
Current valid pfFont Modes: PFFONT_CHAR_SPACING PFFONT_NUM_CHARS
PFFONT_CHAR_SPACING specifies whether to use fixed or variable spacings
for all characters of a pfFont. Possible values are
PFFONT_CHAR_SPACING_FIXED and PFFONT_CHAR_SPACING_VARIABLE - the later
being the default.
pfFont Values:
pfFont::setVal sets a particular value for a given Performer font, while
pfFont::getVal will return the corresponding value associated with the
which token.
Page 3
pfFont(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages pfFont(3pf)NOTES
See pfText for sample code demonstrating pfFont.
SEE ALSO
pfBox, pfDelete, pfGeoSet, pfGeoState, pfString, pfText, pfdLoadFont
Page 4