OpenGL font.
More...
#include <glfont.h>
|
| | cGLFont () |
| | Constructor.
|
| |
| | ~cGLFont () |
| | Destructor.
|
| |
| tResult | Create (const cGLCanvas *, const char *strFilename, tInt nHeight, tStyle eFontStyle) |
| | Creates a font based on the given parameters.
|
| |
| tResult | CleanUp () |
| | Clean up the font.
|
| |
| void | Print (tInt x, tInt y, tFloat64 fAngle, const char *strFormat, va_list ArgList) |
| | Print a string onto the screen.
|
| |
| void | Print (tFloat32 x, tFloat32 y, tFloat64 fAngle, const char *strFormat, va_list ArgList) |
| | Print a string onto the screen.
|
| |
| tVoid | FlipTextHorizontally (tBool bOpposedYAxis) |
| | Set the text direction with or opposed the x-axis direction.
|
| |
| tVoid | TextScaleWithCoordinateSystem (tBool bScaleWithCoordinateSystem) |
| | Set the text to scale with the coordinatesystem.
|
| |
| tVoid | TextRotateWithCoordinateSystem (tBool bRotateWithCoordinateSystem) |
| | Set the text to rotate with the coordinatesystem.
|
| |
| tVoid | TextBaselineOnTop (tBool bTextBaselineOnTop) |
| | Set the text baseline on the top of the text.
|
| |
| virtual | ~IFont () |
| | virtual destructor to ensure proper cleanup.
|
| |
| virtual tResult | Release ()=0 |
| | Releases the font.
|
| |
| virtual tInt | GetHeight () const =0 |
| | This function returns the height of the font in point.
|
| |
| virtual tBool | MeasureText (const tChar *str, tInt &nWidth, tInt &nHeight) const =0 |
| | The methods returns the measurement of the text in nWidth and nHeight.
|
| |
|
| tResult | BuildDisplayList (char ch, tStyle eFontStyle) |
| | Creates a display list for the given character.
|
| |
| void | PrintImpl (tUInt32 ui32Flags, tFloat32 x, tFloat32 y, tFloat64 fAngle, const char *strFormat, va_list ArgList) |
| | Internal print implementation.
|
| |
OpenGL font.
Definition at line 61 of file glfont.h.
◆ cGLFont()
◆ ~cGLFont()
◆ _fnGetNextPowerOfTwo()
| static int _fnGetNextPowerOfTwo |
( |
int | a | ) |
|
|
inlinestaticprotected |
◆ _fnLookupFontFile()
| static bool _fnLookupFontFile |
( |
const char * | strFamily, |
|
|
char * | strFilenameBuffer ) |
|
inlinestaticprotected |
◆ BuildDisplayList()
| tResult BuildDisplayList |
( |
char | ch, |
|
|
tStyle | eFontStyle ) |
|
inlineprotected |
◆ CleanUp()
◆ Create()
| tResult Create |
( |
const cGLCanvas * | , |
|
|
const char * | strFilename, |
|
|
tInt | nHeight, |
|
|
tStyle | eFontStyle ) |
|
inline |
◆ FlipTextHorizontally()
| tVoid FlipTextHorizontally |
( |
tBool | bOpposedYAxis | ) |
|
|
inline |
Set the text direction with or opposed the x-axis direction.
- Parameters
-
| [in] | bOpposedYAxis | tFalse: with the x-axis direction tTrue: opposed the x-axis direction |
- Returns
- void
Definition at line 317 of file glfont.h.
◆ Initialize()
| static tResult Initialize |
( |
| ) |
|
|
inlinestatic |
Initialize the font.
- Returns
- Standard result code
Definition at line 118 of file glfont.h.
Referenced by cGLFont().
◆ Print() [1/2]
| void Print |
( |
tFloat32 | x, |
|
|
tFloat32 | y, |
|
|
tFloat64 | fAngle, |
|
|
const char * | strFormat, |
|
|
va_list | ArgList ) |
|
inline |
Print a string onto the screen.
- Parameters
-
| x | [in] Drawing position x coordinate (floating-point). |
| y | [in] Drawing position y coordinate (floating-point). |
| fAngle | [in] Drawing angle. |
| strFormat | [in] Formatted string. |
| ArgList | [in] Arguments for formatted string. |
Definition at line 305 of file glfont.h.
References PrintImpl().
◆ Print() [2/2]
| void Print |
( |
tInt | x, |
|
|
tInt | y, |
|
|
tFloat64 | fAngle, |
|
|
const char * | strFormat, |
|
|
va_list | ArgList ) |
|
inline |
Print a string onto the screen.
- Parameters
-
| x | [in] Drawing position x coordinate (integer). |
| y | [in] Drawing position y coordinate (integer). |
| fAngle | [in] Drawing angle. |
| strFormat | [in] Formatted string. |
| ArgList | [in] Arguments for formatted string. |
Definition at line 291 of file glfont.h.
References PrintImpl().
◆ PrintImpl()
| void PrintImpl |
( |
tUInt32 | ui32Flags, |
|
|
tFloat32 | x, |
|
|
tFloat32 | y, |
|
|
tFloat64 | fAngle, |
|
|
const char * | strFormat, |
|
|
va_list | ArgList ) |
|
inlineprotected |
Internal print implementation.
- Parameters
-
| ui32Flags | [in] Flags. |
| x | [in] Drawing position x coordinate (floating-point). |
| y | [in] Drawing position y coordinate (floating-point). |
| fAngle | [in] Drawing angle. |
| strFormat | [in] Formatted string. |
| ArgList | [in] Arguments for formatted string. |
Definition at line 605 of file glfont.h.
References m_nHeight, m_nTextureBase, and m_nTextureScale.
Referenced by Print(), and Print().
◆ TextBaselineOnTop()
| tVoid TextBaselineOnTop |
( |
tBool | bTextBaselineOnTop | ) |
|
|
inline |
Set the text baseline on the top of the text.
- Parameters
-
| [in] | bTextBaselineOnTop | if true = top otherwise false = bottom |
- Returns
- void
Definition at line 350 of file glfont.h.
◆ TextRotateWithCoordinateSystem()
| tVoid TextRotateWithCoordinateSystem |
( |
tBool | bRotateWithCoordinateSystem | ) |
|
|
inline |
Set the text to rotate with the coordinatesystem.
- Parameters
-
| [in] | bRotateWithCoordinateSystem | the value to be set |
- Returns
- void
Definition at line 339 of file glfont.h.
◆ TextScaleWithCoordinateSystem()
| tVoid TextScaleWithCoordinateSystem |
( |
tBool | bScaleWithCoordinateSystem | ) |
|
|
inline |
Set the text to scale with the coordinatesystem.
- Parameters
-
| [in] | bScaleWithCoordinateSystem | the value to be set |
- Returns
- void
Definition at line 328 of file glfont.h.
◆ Uninitialize()
| static tResult Uninitialize |
( |
| ) |
|
|
inlinestatic |
Uninitialize the font.
- Returns
- Standard result code
Definition at line 140 of file glfont.h.
Referenced by ~cGLFont().
◆ g_hFreeTypeLibrary
| FT_Library g_hFreeTypeLibrary = NULL |
|
inlinestaticprotected |
◆ g_nCharsetSize
| const tInt g_nCharsetSize = 128 |
|
staticprotected |
◆ g_nLibraryRefCount
| tInt g_nLibraryRefCount = 0 |
|
inlinestaticprotected |
◆ m_aCharWidth
◆ m_hFace
◆ m_hTextures
◆ m_nHeight
◆ m_nTextureBase
◆ m_nTextureScale