This class implements support for 2D fonts.
More...
#include <CFont.h>
|
| void | parseFont (std::istream &a_stream, cFontCharset &a_charsetDesc) |
| | This method parses a font file. More...
|
| |
| void | cleanup () |
| | This method cleans all memory. More...
|
| |
This class provides support for font files generated from AngelSoft's Bitmap Font Generator application. This program will allow you to generate bitmap fonts from TrueType fonts. The application generates both image files and character descriptions that can be read by a game for easy rendering of fonts. These files can then be loaded into the cFont class by using the loadFromFile() method.
Constructor of class cFont.
| chai3d::cFont::~cFont |
( |
| ) |
|
|
virtual |
Destructor of class cFont.
| bool chai3d::cFont::loadFromFile |
( |
const std::string & |
a_filename | ) |
|
This method loads a font from the specified file.
- Parameters
-
| std::string chai3d::cFont::getFilename |
( |
| ) |
const |
|
inline |
| double chai3d::cFont::getPointSize |
( |
| ) |
const |
|
inline |
| double chai3d::cFont::getTextWidth |
( |
const std::string & |
a_text | ) |
|
This method computes the width of a string a_text passed as argument.
- Parameters
-
- Returns
- Width of input text.
| double chai3d::cFont::renderText |
( |
const std::string & |
a_text, |
|
|
const cColorf & |
a_color, |
|
|
const double |
a_fontScale, |
|
|
cRenderOptions & |
a_options |
|
) |
| |
This method renders a single string and returns its length.
- Parameters
-
| a_text | String to be rendered. |
| a_color | Font Color |
| a_fontScale | Font scale factor |
| a_options | Rendering options. |
- Returns
- Length of string.
| void chai3d::cFont::parseFont |
( |
std::istream & |
a_stream, |
|
|
cFontCharset & |
a_charsetDesc |
|
) |
| |
|
protected |
This method parses a font from the specified stream.
- Parameters
-
| a_stream | Font filename |
| a_charsetDesc | Description of the new charset. |
| void chai3d::cFont::cleanup |
( |
| ) |
|
|
protected |
This method cleans up all data structures.
| cFontCharset chai3d::cFont::m_charset |
| std::string chai3d::cFont::m_filename |
|
protected |
The documentation for this class was generated from the following files: