CEGUI::PixmapFont Class Reference

Implementation of the Font class interface using static Imageset's. More...

Inheritance diagram for CEGUI::PixmapFont:

Inheritance graph
[legend]
Collaboration diagram for CEGUI::PixmapFont:

Collaboration graph
[legend]

List of all members.

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

Imagesetd_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


Detailed Description

Implementation of the Font class interface using static Imageset's.

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).


Constructor & Destructor Documentation

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.

Parameters:
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.
Exceptions:
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.

Parameters:
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.


Member Function Documentation

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]

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.

Parameters:
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().


Generated on Thu Nov 27 20:34:30 2008 for Crazy Eddies GUI System by  doxygen 1.5.7.1