Public Member Functions | |
virtual void | load () |
Protected Member Functions | |
PixmapFont (const String &name, const String &fontname, const String &resourceGroup="") | |
Constructs a new semi-complete Font object. It is the responsability of the user to define the glyph mapping (via the Mapping property), and finally call the load() method which will make font available for use (this is not *required* for PixmapFont, though). | |
PixmapFont (const XMLAttributes &attributes) | |
virtual | ~PixmapFont () |
virtual void | updateFont () |
virtual void | writeXMLToStream_impl (XMLSerializer &xml_stream) const |
virtual void | defineMapping (const XMLAttributes &attributes) |
Define a glyph mapping (handle a <Mapping> XML element). | |
void | defineMapping (String image_name, utf32 codepoint, float horzAdvance) |
Define a single glyph mapping. | |
void | addPixmapFontProperties () |
Register all properties of this class. | |
void | reinit () |
Initialize the imageset. | |
Protected Attributes | |
Imageset * | d_glyphImages |
The imageset with the glyphs. | |
float | d_origHorzScaling |
Current X scaling for glyph images. | |
bool | d_imagesetOwner |
true if we're the owners of the imageset | |
Friends | |
class | FontManager |
class | FontProperties::PixmapImageset |
class | FontProperties::PixmapMapping |
To create such a font you must create a Imageset with all the glyphs, and then define individual glyphs via the Mapping object property (or via the Mapping XML element).
CEGUI::PixmapFont::PixmapFont | ( | const String & | name, | |
const String & | fontname, | |||
const String & | resourceGroup = "" | |||
) | [protected] |
Constructs a new semi-complete Font object. It is the responsability of the user to define the glyph mapping (via the Mapping property), and finally call the load() method which will make font available for use (this is not *required* for PixmapFont, though).
All font parameters that are not initialized are set to sensible default values.
name | The unique name that will be used to identify this Font. | |
fontname | The filename of the font file, which contains the font data. This can be a TrueType, PostScript, bitmap font etc file. If resourceGroup is set to the special value of "*", fontname is interpreted as a imageset name and the respective Imageset object must be already loaded. | |
resourceGroup | Resource group identifier to be passed to the resource provider to load the font definition file. |
UnknownObjectException | Thrown if no Imageset named filename is present in within the system (when resourceGroup == "*"). |
References reinit().
CEGUI::PixmapFont::PixmapFont | ( | const XMLAttributes & | attributes | ) | [protected] |
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.
name | The unique name that will be used to identify this Font. | |
fontname | The filename of the font file, which contains the font data. This can be a TrueType, PostScript, bitmap font etc file. | |
resourceGroup | Resource group identifier to be passed to the resource provider to load the font definition file. |
References reinit().
CEGUI::PixmapFont::~PixmapFont | ( | ) | [protected, virtual] |
Destroys a Font object.
References d_glyphImages, and d_imagesetOwner.
void CEGUI::PixmapFont::load | ( | ) | [virtual] |
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.
Implements CEGUI::Font.
References CEGUI::Font::d_cp_map, CEGUI::Font::d_fileName, CEGUI::Font::d_name, CEGUI::Font::d_resourceGroup, CEGUI::String::empty(), and updateFont().
void CEGUI::PixmapFont::updateFont | ( | ) | [protected, virtual] |
Update the font as required according to the current parameters.
Implements CEGUI::Font.
References CEGUI::Font::d_ascender, CEGUI::Font::d_autoScale, CEGUI::Font::d_cp_map, CEGUI::Font::d_descender, d_glyphImages, CEGUI::Font::d_height, CEGUI::Font::d_horzScaling, CEGUI::Font::d_maxCodepoint, CEGUI::Font::d_nativeHorzRes, CEGUI::Font::d_nativeVertRes, d_origHorzScaling, CEGUI::Image::getHeight(), CEGUI::Image::getOffsetY(), CEGUI::Imageset::setAutoScalingEnabled(), and CEGUI::Imageset::setNativeResolution().
Referenced by load().
void CEGUI::PixmapFont::writeXMLToStream_impl | ( | XMLSerializer & | xml_stream | ) | const [protected, virtual] |
Same as writeXMLToStream() but called from inside writeXMLToStream() so that derived classes may add their own attributes to stream.
xml_stream | Stream where xml data should be output. |
Implements CEGUI::Font.
References CEGUI::XMLSerializer::attribute(), CEGUI::XMLSerializer::closeTag(), CEGUI::Font::d_cp_map, d_origHorzScaling, and CEGUI::XMLSerializer::openTag().