glictFont Class Reference

#include <fonts.h>

List of all members.


Detailed Description

Represents one font usable by GLICT. (GLICT currently uses only one, "system").
Examples:

examples/memory/main.cpp, and examples/memory_sdl/main.cpp.

Definition at line 49 of file fonts.h.


Public Member Functions

void * GetFontParam ()
std::string GetName ()
 glictFont ()
void SetFontParam (void *font)
void SetName (const char *newname)
void SetRenderFunc (_glictFontRenderFuncVoidNoSize funcpointer)
 Sets the render function that will be used to draw font. (Version with size, without success return).
void SetRenderFunc (_glictFontRenderFuncBoolNoSize funcpointer)
 Sets the render function that will be used to draw font. (Version with size, with success return).
void SetSizeFunc (_glictFontSizeFuncSize funcpointer)
 Sets the size function that will be used to get text width. (Version with size).
 ~glictFont ()

Private Attributes

void * fontparam
std::string name
_glictFontRenderFuncBoolNoSize RenderBoolNoSize
_glictFontRenderFuncBoolSize RenderBoolSize
_glictFontRenderFuncVoidNoSize RenderVoidNoSize
_glictFontRenderFuncVoidSize RenderVoidSize
_glictFontSizeFuncNoSize SizeNoSize
_glictFontSizeFuncSize SizeSize

Friends

bool glictFontRender (const char *text, const char *fontname, float fontsize, float x, float y)
 Renders the font using specified size.
bool glictFontRender (const char *text, const char *fontname, float x, float y)
 Renders the font using default size.
float glictFontSize (const char *name, const char *font, float size)
float glictFontSize (const char *name, const char *font)

Member Function Documentation

void glictFont::SetRenderFunc ( _glictFontRenderFuncVoidNoSize  funcpointer  ) 

Sets the render function that will be used to draw font. (Version with size, without success return).

Sets the render function that will be used to draw font. (Version without size, without success return).

Definition at line 260 of file fonts.cpp.

References RenderBoolNoSize, RenderBoolSize, RenderVoidNoSize, RenderVoidSize, and SetRenderFunc().

void glictFont::SetRenderFunc ( _glictFontRenderFuncBoolNoSize  funcpointer  ) 

Sets the render function that will be used to draw font. (Version with size, with success return).

Sets the render function that will be used to draw font. (Version without size, with success return).

Examples:
examples/memory/main.cpp, and examples/memory_sdl/main.cpp.

Definition at line 244 of file fonts.cpp.

References RenderBoolNoSize, RenderBoolSize, RenderVoidNoSize, RenderVoidSize, and SetRenderFunc().

Referenced by SetRenderFunc().

void glictFont::SetSizeFunc ( _glictFontSizeFuncSize  funcpointer  ) 

Sets the size function that will be used to get text width. (Version with size).

Sets the size function that will be used to get text width. (Version without size).

Examples:
examples/memory/main.cpp, and examples/memory_sdl/main.cpp.

Definition at line 276 of file fonts.cpp.

References SizeNoSize, and SizeSize.


Friends And Related Function Documentation

bool glictFontRender ( const char *  text,
const char *  fontname,
float  fontsize,
float  x,
float  y 
) [friend]

Renders the font using specified size.

Parameters:
text Specifies the text being drawn
fontname Specifies name of font used for rendering
fontsize Specifies size of font used for rendering
x X coordinate of destination
y Y coordinate of destination
Renders the text specified using the default font size. This function finds the font specified by fontname parameter, and then calls its render function.

If needed to call many times, you should consider finding the class of the font you're trying to render using glictFindFont() and remember its pointer, then call it directly, especially if you load tons of fonts.

Default size is set to 10. Font resizer believes the font is rendered at size 1.

There is an overloaded variant of this function that renders using default font size.

Definition at line 153 of file fonts.cpp.

bool glictFontRender ( const char *  text,
const char *  fontname,
float  x,
float  y 
) [friend]

Renders the font using default size.

Parameters:
text Specifies the text being drawn
fontname Specifies name of font used for rendering
x X coordinate of destination
y Y coordinate of destination
Renders the text specified using the default font size. This function finds the font specified by fontname parameter, and then calls its render function.

If needed to call many times, you should consider finding the class of the font you're trying to render using glictFindFont() and remember its pointer, then call it directly, especially if you load tons of fonts.

Default size is set to 10. Font resizer believes the font is rendered at size 1.

There is an overloaded variant of this function that allows specifying font size as third parameter.

See also:
glictFont::SetRenderFunc

Definition at line 119 of file fonts.cpp.


The documentation for this class was generated from the following files:
SourceForge.net Logo
generated with doxygen 1.5.3 on Mon Oct 29 18:09:27 2007