Font class. More...
#include <gelFont.h>
Public Member Functions | |
GelFont () | |
Default constructor. | |
GelFont (GelString filename, ImageType type) | |
Gel2D Bitmap Font constructor. | |
GelFont (GelString filename) | |
Gel2D Font constructor. | |
~GelFont () | |
Destructor. | |
bool | loadFont (GelString filename, int start, int stop, int height, int padding, int spacing, bool usealpha, bool antialias) |
Loads a TrueType/OpenType font from disk. | |
bool | readBmpFont (GelString filename, ImageType type) |
Reads a bitmap font description file from disk. | |
bool | writeBmpFont (GelString filename, ImageType type) |
Writes a bitmap font description file to disk. | |
bool | readFont (GelString filename) |
Reads a font description file from disk. | |
bool | writeFont (GelString filename, GelString fontname, int start, int stop, int height, int padding, int spacing, bool usealpha, bool antialias) |
Writes a font description file to disk. | |
GelTexture * | getTexture () const |
Gets a pointer to the font's texture. | |
int | getLineHeight () const |
Gets the font's line height in pixels. | |
Public Attributes | |
GelFontChar | fchar [256] |
Font class.
This class stores font information which can be used by other classes to print text.
GelFont can read and write font information in two ways:
1. A small binary description file containing the name of a TrueType/OpenType font file, and a few paramaters describing how the font should be loaded.
2. A binary description file containing information on each character in the font, and an accompanying bitmap image file of all the characters.
gel::GelFont::GelFont | ( | ) |
Default constructor.
Gel2D Bitmap Font constructor.
gel::GelFont::GelFont | ( | GelString | filename | ) |
Gel2D Font constructor.
gel::GelFont::~GelFont | ( | ) |
Destructor.
bool gel::GelFont::loadFont | ( | GelString | filename, |
int | start, | ||
int | stop, | ||
int | height, | ||
int | padding, | ||
int | spacing, | ||
bool | usealpha, | ||
bool | antialias | ||
) |
Loads a TrueType/OpenType font from disk.
Reads a bitmap font description file from disk.
This function will load a Gel2D Bitmap Font, and load the image corresponding to the given filename and image type.
filename | : The directory / name of the description file. |
type | : The image type of the corresponding image file. |
Writes a bitmap font description file to disk.
This function will write a Gel2D Bitmap Font, along with an image corresponding to the given filename and image type.
filename | : The directory / name of the description file. |
type | : The image type of the corresponding image file. |
bool gel::GelFont::readFont | ( | GelString | filename | ) |
Reads a font description file from disk.
This function will read a font description file and load the TrueType/OpenType font specified therein.
filename | : The directory / name of the description file. |
bool gel::GelFont::writeFont | ( | GelString | filename, |
GelString | fontname, | ||
int | start, | ||
int | stop, | ||
int | height, | ||
int | padding, | ||
int | spacing, | ||
bool | usealpha, | ||
bool | antialias | ||
) |
Writes a font description file to disk.
This function will write a font description file with the given parameters.
GelTexture* gel::GelFont::getTexture | ( | ) | const [inline] |
Gets a pointer to the font's texture.
int gel::GelFont::getLineHeight | ( | ) | const [inline] |
Gets the font's line height in pixels.
API Documentation by Mark D. Procarione | Generated by |