#include <fontfile.h>
Whole font is opened first and then you can query each character separetelly. In fact only those characters are loaded that you want to use. Characters are converted into small bitmap with 256 gray levels. You need to set character size and resolution first.
This class is the base for all font files.
Public Member Functions | |
FontFile () | |
virtual | ~FontFile () |
void | SetCharSize (const FontFile::CharSize &char_size) |
virtual byte_t * | GetData (ulong_t char_code, bool close=false) |
const GlyphData & | GetGlyphData () |
ulong_t | GetGlyphsCount () |
Public Attributes | |
ulong_t | glyphs_count |
Number of all glyphs. | |
Protected Member Functions | |
virtual void | DeleteData () |
Protected Attributes | |
GlyphData | glyph_data |
Data of one loaded glyph. | |
CharSize | char_size |
Size of character. | |
uchar_t * | data |
Loaded character converted into bitmap buffer. | |
Classes | |
struct | CharSize |
struct | GlyphData |
FontFile::FontFile | ( | ) |
Constructor. Sets file mode to binary. Default glyph size is set to 12, resolution to 96.
FontFile::~FontFile | ( | ) | [virtual] |
Destructor.
void FontFile::SetCharSize | ( | const FontFile::CharSize & | char_size | ) | [inline] |
Sets character size. This information will be used to convert characters into bitmap.
char_size | Structure with character size and resolution. |
Returns bitmap of one character.
char_code | Code of wanted character. | |
close | Whether file will be closed after returning the data. |
Reimplemented in FreeTypeFontFile.
const FontFile::GlyphData & FontFile::GetGlyphData | ( | ) | [inline] |
Returns glyph data of loaded character.
ulong_t FontFile::GetGlyphsCount | ( | ) | [inline] |
Returns number of glyphs (characters) in font file.
void FontFile::DeleteData | ( | ) | [protected, virtual] |
Deletes loaded data.
Implements DataFile.
Number of all glyphs.
GlyphData FontFile::glyph_data [protected] |
Data of one loaded glyph.
CharSize FontFile::char_size [protected] |
Size of character.
uchar_t* FontFile::data [protected] |
Loaded character converted into bitmap buffer.