GLICT/fonts.h File Reference


Detailed Description

Font management.

Declares stuff used in fonts.cpp

See also:
fonts.cpp

Definition in file fonts.h.

#include <string>
#include <vector>

Go to the source code of this file.

Classes

class  glictFont
 Represents one font usable by GLICT. (GLICT currently uses only one, "system"). More...

Typedefs

typedef bool(* _glictFontRenderFuncBoolNoSize )(const char *text, const void *font, float x, float y)
typedef bool(* _glictFontRenderFuncBoolNoSize )(const char *text, const void *font, float x, float y)
typedef bool(* _glictFontRenderFuncBoolSize )(const char *text, const void *font, float size, float x, float y)
typedef bool(* _glictFontRenderFuncBoolSize )(const char *text, const void *font, float size, float x, float y)
typedef void(* _glictFontRenderFuncVoidNoSize )(const char *text, const void *font, float x, float y)
typedef void(* _glictFontRenderFuncVoidNoSize )(const char *text, const void *font, float x, float y)
typedef void(* _glictFontRenderFuncVoidSize )(const char *text, const void *font, float size, float x, float y)
typedef void(* _glictFontRenderFuncVoidSize )(const char *text, const void *font, float size, float x, float y)
typedef float(* _glictFontSizeFuncNoSize )(const char *text, const void *font)
typedef float(* _glictFontSizeFuncSize )(const char *text, const void *font, float size)
typedef std::vector
< glictFont * > 
_GLICTFONTVECTOR
typedef
_GLICTFONTVECTOR::iterator 
_GLICTFONTVECTORITERATOR

Functions

glictFontglictCreateFont (const char *name)
 Creates the font for further use.
bool glictDeleteFont (const char *name)
glictFontglictFindFont (const char *name)
int glictFontNumberOfLines (const char *text)
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)


Function Documentation

glictFont* glictCreateFont ( const char *  name  ) 

Creates the font for further use.

Parameters:
name Specifies the font name that'll be used when referencing to this font
Using this function, font space is created and reserved for future use. To make this font space make sense, you need to assign the render and size functions. Specify the render function using SetRenderFunc(), and specify the size function using SetSizeFunc(). They are overloaded and there are several flavours of each, so you have some flexibility in designing your font system.

See also:
glictFont::SetRenderFunc(), glictFont::SetSizeFunc()

Definition at line 61 of file fonts.cpp.

References glictFindFont(), glictFonts, and glictFont::SetName().

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

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.

References glictFont::fontparam, glictFont::GetName(), glictFindFont(), glictFont::RenderBoolNoSize, glictFont::RenderBoolSize, glictFont::RenderVoidNoSize, and glictFont::RenderVoidSize.

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

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.

References glictFontRender().


SourceForge.net Logo
generated with doxygen 1.5.3 on Mon Oct 29 18:09:26 2007