C4 Engine
C4 Engine API Documentation


Defined in:  C4Slug.h
Returns a new reference to a font object.

static Font *GetFont(const char *name);

name The name of the font resource.
The GetFont function returns a new reference to the font object specified by the name parameter. If the font resource has already been loaded, then its reference count is incremented and a pointer to the existing object is returned. If the font specified by the name parameter does not exist, then a pointer to the default font is returned.

The Shared::Release function must be called for the returned font object to balance each call to the GetFont function. A convenient way to accomplish this automatically is to use the AutoReleaseFont class.
See Also