Inheritance diagram for CEGUI::FreeTypeFont:
Public Member Functions | ||||||||||
virtual void | load () | |||||||||
Complete font loading. If you create the font from an XML file, this method is invoked automatically after reading all the required data from the XMLAttributes object. If you create the font manually, it is your responsability to call this function as soon as you set up all the appropiate fields of the Font object. | ||||||||||
virtual void | rasterize (utf32 start_codepoint, utf32 end_codepoint) | |||||||||
This function prepares a certain range of glyphs to be ready for displaying. This means that after returning from this function glyphs from d_cp_map[start_codepoint] to d_cp_map[end_codepoint] should have their d_image member set. If there is an error during rasterization of some glyph, it's okay to leave the d_image field set to NULL, in which case such glyphs will be skipped from display.
| ||||||||||
Protected Types | ||||||||||
typedef std::vector< Imageset * > | ImagesetVector | |||||||||
Protected Member Functions | ||||||||||
void | drawGlyphToBuffer (argb_t *buffer, uint buf_width) | |||||||||
Copy the current glyph data into buffer, which has a width of buf_width pixels (not bytes). | ||||||||||
uint | getTextureSize (CodepointMap::const_iterator s, CodepointMap::const_iterator e) | |||||||||
Return the required texture size required to store imagery for the glyphs from s to e. | ||||||||||
FreeTypeFont (const String &name, const String &filename, const String &resourceGroup) | ||||||||||
Constructs a new semi-complete Font object. It is the responsability of the user to set up all remaining font parameters after constructing the Font object, and finally calling the load() method which will make font available for use. All font parameters that are not initialized are set to sensible default values.
| ||||||||||
FreeTypeFont (const XMLAttributes &attributes) | ||||||||||
Constructs a new semi-complete Font object. It is the responsability of the user to set up all remaining font parameters after constructing the Font object, and finally calling the load() method which will make font available for use. All font parameters that are not initialized are set to sensible default values.
| ||||||||||
virtual | ~FreeTypeFont () | |||||||||
Destroys a Font object. | ||||||||||
virtual void | updateFont () | |||||||||
Update the font as required according to the current parameters. | ||||||||||
virtual void | writeXMLToStream_impl (XMLSerializer &xml_stream) const | |||||||||
Same as writeXMLToStream() but called from inside writeXMLToStream() so that derived classes may add their own attributes to stream.
| ||||||||||
void | addFreeTypeFontProperties () | |||||||||
Register all properties of this class. | ||||||||||
void | free () | |||||||||
Free all allocated font data. | ||||||||||
Protected Attributes | ||||||||||
ImagesetVector | d_glyphImages | |||||||||
Imagesets that holds the glyphs for this font. | ||||||||||
float | d_ptSize | |||||||||
Point size of font. | ||||||||||
bool | d_antiAliased | |||||||||
True if the font should be rendered as anti-alaised by freeType. | ||||||||||
FT_Face | d_fontFace | |||||||||
FreeType-specific font handle. | ||||||||||
RawDataContainer | d_fontData | |||||||||
Font file data. | ||||||||||
Friends | ||||||||||
class | FontManager | |||||||||
class | FontProperties::FreeTypePointSize | |||||||||
class | FontProperties::FreeTypeAntialiased |
This implementation tries to provide maximal support for any kind of fonts supported by FreeType. It has been tested on outline font formats like TTF and PS as well as on bitmap font formats like PCF and FON.
Glyphs are rendered dynamically on demand, so a large font with lots of glyphs won't slow application startup time.
void CEGUI::FreeTypeFont::drawGlyphToBuffer | ( | argb_t * | buffer, | |
uint | buf_width | |||
) | [protected] |
Copy the current glyph data into buffer, which has a width of buf_width pixels (not bytes).
buffer | Memory buffer large enough to receive the imagery for the currently loaded glyph. | |
buf_width | Width of buffer in pixels (where each pixel is a argb_t). |
uint CEGUI::FreeTypeFont::getTextureSize | ( | CodepointMap::const_iterator | s, | |
CodepointMap::const_iterator | e | |||
) | [protected] |
Return the required texture size required to store imagery for the glyphs from s to e.
s | The first glyph in set | |
e | The last glyph in set |