45 #include "UI/textureatlas.h"
63 delete (*GlyphIt).second;
95 {
return this->
Atlas; }
103 if( GlyphIt != this->
Glyphs.end() )
return (*GlyphIt).second;
128 if( GlyphIt == this->
Glyphs.end() ) { this->
Glyphs.insert(std::pair<UInt32,Glyph*>(NewGlyph->
GlyphID,NewGlyph)); }
132 ExceptionStream <<
"Glyph of ID: " << NewGlyph->
GlyphID <<
" already exists in Font: \"" << this->
FontName <<
"\".";
139 Glyph* WhiteSpace = NULL;
void _SetSpaceLength(const Real SL)
Sets the length of a space for this font.
Thrown when duplicates of teh same identity string exist.
Real GetLineHeight() const
Gets the height of a line of text in this font.
const String & GetAtlasName() const
Gets the name of the TextureAtlas this font belongs to.
const String & GetName() const
Gets the name of this Texture Atlas.
Class used to describe a single glyph or character available for text operations. ...
~FontData()
Class destructor.
void _SetLetterSpacing(const Real LS)
Sets the LetterSpacing of this font.
void _GenerateWhitespaceGlyphs()
Generates Whitespace Glyphs from this font's data for this font.
void _SetName(const String &Name)
Sets the name of this font.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
Real GetSpaceLength() const
Gets the length of a space in this font.
GlyphContainer::iterator GlyphIterator
Iterator type for Glyphs stored by this class.
Real SpaceLength
The width in pixels of a space in this font.
This is a collection of smaller textures packed into a larger texture, intended to increase UI perfor...
FontData(TextureAtlas *ParentAtlas)
Class constructor.
std::stringstream StringStream
A Datatype used for streaming operations with strings.
void SetWhitespaceAtlasCoords(Glyph *Whitespace)
Sets the dummy coordinates for a generated whitespace glyph.
float Real
A Datatype used to represent a real floating point number.
Real BaseLine
The height of the largest glyph in this font.
GlyphContainer::const_iterator ConstGlyphIterator
Const Iterator type for Glyphs stored by this class.
Real LetterSpacing
I don't know.
GlyphContainer Glyphs
Container storing all the Glyphs contained in this font.
uint32_t UInt32
An 32-bit unsigned integer.
const String & GetName() const
Gets the name of this font.
void _SetBaseLine(const Real BL)
Sets the height of the largest glyph in this font.
Vector2 AtlasCoords[4]
The 4 corner coordinates on the Texture.
TextureAtlas * GetAtlas() const
Gets the TextureAtlas this font belongs to.
void _SetLineHeight(const Real LH)
Sets the height of a single line of text in this font.
The bulk of the engine components go in this namspace.
Real GetBaseLine() const
Gets the height of the largest glyph in this font.
Vector2 GetWhitePixel() const
Gets the location of the WhitePixel on the TextureAtlas.
String FontName
The name of this font.
TextureAtlas * Atlas
The Atlas that this GlyphData belongs to.
std::string String
A datatype used to a series of characters.
void _AddGlyph(Glyph *NewGlyph)
Adds a new glyph to this Font. exception will be thrown if a glyph with the same ID is already taken...
UInt32 GlyphID
The Character this glyph information represents.
Glyph * GetGlyph(const UInt32 &GlyphID) const
Gets the glyph corresponding to the provided characters UTF-8 code.
Real GetLetterSpacing() const
Gets the spacing to apply between letters in this font.
Real LineHeight
The height of a line of text in this font.