GLFX::IFont Struct Reference

#include <glfx.h>

Inheritance diagram for GLFX::IFont:

GLFX::IObject List of all members.

Public Types

enum  { SINGLE_LINE, MULTI_LINE, CHAR_WRAP, WORD_WRAP }

Public Member Functions

virtual GLuint GetTexture ()=0
virtual void DrawChar (float x, float y, float z, int c, float *bounds)=0
virtual void DrawString (float x, float y, float z, const char *strBegin, const char *strEnd, unsigned long mode, float lineWidth, float *bounds)=0
virtual unsigned long GetGlyphHeight ()=0
virtual unsigned long GetGlyphBaseLine ()=0
virtual float ComputeStringWidth (const char *strBegin, const char *strEnd, unsigned long mode, float lineWidth)=0
virtual unsigned long ComputeStringLineCount (const char *strBegin, const char *strEnd, unsigned long mode, float lineWidth)=0
virtual void SetTabSize (unsigned long horizontal)=0

Member Enumeration Documentation

anonymous enum

String rendering modes.

Enumerator:
SINGLE_LINE  Single line string rendering mode.
MULTI_LINE  Multiline string rendering, without wrapping.
CHAR_WRAP  Multiline string rendering, wrapping on characters which pass over lineWidth.
WORD_WRAP  Multiline string rendering, wrapping on words which pass over lineWidth.

If a line is longer than lineWidth it will be wrapped on first character, which is outside lineWidth.


Member Function Documentation

virtual GLuint GLFX::IFont::GetTexture (  )  [pure virtual]

Returns OpenGL texture id.

Returns:
texture id

virtual void GLFX::IFont::DrawChar ( float  x,
float  y,
float  z,
int  c,
float *  bounds 
) [pure virtual]

Draws a single character.

Parameters:
x x-coord of the character
y y-coord of the character
z z-coord of the character
c character code, currently only 7-bit ASCII values are acceppted (other may produce unexpected results)
bounds a array of 4 values (minX, minY, maxX, maxY) defining the bounding box, where drawing is allowed; ignored if 0

virtual void GLFX::IFont::DrawString ( float  x,
float  y,
float  z,
const char *  strBegin,
const char *  strEnd,
unsigned long  mode,
float  lineWidth,
float *  bounds 
) [pure virtual]

Draws multiples characters in the given mode.

Parameters:
x x-coord of the begin of the string
y y-coord of the begin of the string
z z-coord of the begin of the string
strBegin first character of the string
strEnd last character of the string; specifying 0 causes strBegin to be treated as null-terminated string
mode text rendering mode, may be one of SINGLE_LINE, MULTI_LINE, CHAR_WRAP or WORD_WRAP
lineWidth maximum width of string, if 0 no such width exists
bounds a array of 4 values (minX, minY, maxX, maxY) defining the bounding box, where drawing is allowed; ignored if 0

virtual unsigned long GLFX::IFont::GetGlyphHeight (  )  [pure virtual]

Returns the height of this font.

Returns:
height of this font

virtual unsigned long GLFX::IFont::GetGlyphBaseLine (  )  [pure virtual]

Returns the distance from glyph image top to the font base line.

Returns:
glyph base line

virtual float GLFX::IFont::ComputeStringWidth ( const char *  strBegin,
const char *  strEnd,
unsigned long  mode,
float  lineWidth 
) [pure virtual]

Returns the width of a string.

Parameters:
strBegin first character of the string
strEnd last character of the string; specifying 0 causes strBegin to be treated as null-terminated string
mode text rendering mode, may be one of SINGLE_LINE, MULTI_LINE, CHAR_WRAP or WORD_WRAP
lineWidth maximum width of string, if 0 no such width exists
Returns:
width of the string i.e. maximum of width of all lines

virtual unsigned long GLFX::IFont::ComputeStringLineCount ( const char *  strBegin,
const char *  strEnd,
unsigned long  mode,
float  lineWidth 
) [pure virtual]

Returns number of lines in a string.

Parameters:
strBegin first character of the string
strEnd last character of the string; specifying 0 causes strBegin to be treated as null-terminated string
mode text rendering mode, may be one of SINGLE_LINE, MULTI_LINE, CHAR_WRAP or WORD_WRAP
lineWidth maximum width of string, if 0 no such width exists
Returns:
number of lines

virtual void GLFX::IFont::SetTabSize ( unsigned long  horizontal  )  [pure virtual]

Sets horizontal tab size.

Parameters:
horizontal horizontal tab size, default value is 4


The documentation for this struct was generated from the following file:
SourceForge.net Logo