Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mezzanine::UI::FontData Class Reference

This class represents a collection of Glyphs in a common visual style. More...

#include <font.h>

+ Collaboration diagram for Mezzanine::UI::FontData:

Public Types

typedef GlyphContainer::const_iterator ConstGlyphIterator
 Const Iterator type for Glyphs stored by this class.
 
typedef std::map< UInt32, Glyph * > GlyphContainer
 Container type for Glyph storage in this class.
 
typedef GlyphContainer::iterator GlyphIterator
 Iterator type for Glyphs stored by this class.
 

Public Member Functions

 FontData (TextureAtlas *ParentAtlas)
 Class constructor. More...
 
 ~FontData ()
 Class destructor.
 
void _AddGlyph (Glyph *NewGlyph)
 Adds a new glyph to this Font.

Exceptions
Anexception will be thrown if a glyph with the same ID is already taken.
More...
 
void _GenerateWhitespaceGlyphs ()
 Generates Whitespace Glyphs from this font's data for this font.
 
void _SetBaseLine (const Real BL)
 Sets the height of the largest glyph in this font. More...
 
void _SetLetterSpacing (const Real LS)
 Sets the LetterSpacing of this font. More...
 
void _SetLineHeight (const Real LH)
 Sets the height of a single line of text in this font. More...
 
void _SetName (const String &Name)
 Sets the name of this font. More...
 
void _SetSpaceLength (const Real SL)
 Sets the length of a space for this font. More...
 
TextureAtlasGetAtlas () const
 Gets the TextureAtlas this font belongs to. More...
 
const StringGetAtlasName () const
 Gets the name of the TextureAtlas this font belongs to. More...
 
Real GetBaseLine () const
 Gets the height of the largest glyph in this font. More...
 
GlyphGetGlyph (const UInt32 &GlyphID) const
 Gets the glyph corresponding to the provided characters UTF-8 code. More...
 
Real GetLetterSpacing () const
 Gets the spacing to apply between letters in this font. More...
 
Real GetLineHeight () const
 Gets the height of a line of text in this font. More...
 
const StringGetName () const
 Gets the name of this font. More...
 
Real GetSpaceLength () const
 Gets the length of a space in this font. More...
 

Protected Member Functions

void SetWhitespaceAtlasCoords (Glyph *Whitespace)
 Sets the dummy coordinates for a generated whitespace glyph.
 

Protected Attributes

TextureAtlasAtlas
 The Atlas that this GlyphData belongs to. More...
 
Real BaseLine
 The height of the largest glyph in this font. More...
 
String FontName
 The name of this font. More...
 
GlyphContainer Glyphs
 Container storing all the Glyphs contained in this font. More...
 
Real LetterSpacing
 I don't know. More...
 
Real LineHeight
 The height of a line of text in this font. More...
 
Real SpaceLength
 The width in pixels of a space in this font. More...
 

Detailed Description

This class represents a collection of Glyphs in a common visual style.

Definition at line 55 of file font.h.

Constructor & Destructor Documentation

Mezzanine::UI::FontData::FontData ( TextureAtlas ParentAtlas)

Class constructor.

Parameters
ParentAtlasThe TextureAtlas this font data belongs to.

Definition at line 51 of file font.cpp.

Member Function Documentation

void Mezzanine::UI::FontData::_AddGlyph ( Glyph NewGlyph)

Adds a new glyph to this Font.

Exceptions
Anexception will be thrown if a glyph with the same ID is already taken.

Parameters
NewGlyphA pointer to the new glyph to be added.

Definition at line 125 of file font.cpp.

void Mezzanine::UI::FontData::_SetBaseLine ( const Real  BL)

Sets the height of the largest glyph in this font.

Parameters
BLThe maximum height of a glyph in this font in pixels.

Definition at line 116 of file font.cpp.

void Mezzanine::UI::FontData::_SetLetterSpacing ( const Real  LS)

Sets the LetterSpacing of this font.

Parameters
LSThe value to be set for this fonts LetterSpacing.

Definition at line 119 of file font.cpp.

void Mezzanine::UI::FontData::_SetLineHeight ( const Real  LH)

Sets the height of a single line of text in this font.

Parameters
LHThe height of a line of text in this font in pixels.

Definition at line 113 of file font.cpp.

void Mezzanine::UI::FontData::_SetName ( const String Name)

Sets the name of this font.

Parameters
NameThe name to be given to this font.

Definition at line 122 of file font.cpp.

void Mezzanine::UI::FontData::_SetSpaceLength ( const Real  SL)

Sets the length of a space for this font.

Parameters
SLThe length of a space in pixels.

Definition at line 110 of file font.cpp.

TextureAtlas * Mezzanine::UI::FontData::GetAtlas ( ) const

Gets the TextureAtlas this font belongs to.

Returns
Returns a pointer to the TextureAtlas this font belongs to.

Definition at line 94 of file font.cpp.

const String & Mezzanine::UI::FontData::GetAtlasName ( ) const

Gets the name of the TextureAtlas this font belongs to.

Returns
Returns a const String reference containing the name of the TextureAtlas this font belongs to.

Definition at line 97 of file font.cpp.

Real Mezzanine::UI::FontData::GetBaseLine ( ) const

Gets the height of the largest glyph in this font.

Returns
Returns a Real containing the height of the largest glyph in this font in pixels.

Definition at line 85 of file font.cpp.

Glyph * Mezzanine::UI::FontData::GetGlyph ( const UInt32 GlyphID) const

Gets the glyph corresponding to the provided characters UTF-8 code.

Parameters
GlyphIDThe UTF-8 code for the glyph desired.
Returns
Returns a pointer to the requested Glyph, or NULL if it doesn't exist.

Definition at line 100 of file font.cpp.

Real Mezzanine::UI::FontData::GetLetterSpacing ( ) const

Gets the spacing to apply between letters in this font.

Returns
Returns a Real containing the amount of pixels to adjust the advance of every glyph in this font.

Definition at line 88 of file font.cpp.

Real Mezzanine::UI::FontData::GetLineHeight ( ) const

Gets the height of a line of text in this font.

Returns
Returns a Real containing the height of a line in this font in pixels.

Definition at line 82 of file font.cpp.

const String & Mezzanine::UI::FontData::GetName ( ) const

Gets the name of this font.

Returns
Returns a const String reference containing the name of this font.

Definition at line 91 of file font.cpp.

Real Mezzanine::UI::FontData::GetSpaceLength ( ) const

Gets the length of a space in this font.

Returns
Returns a Real containing the length of a space in pixels.

Definition at line 79 of file font.cpp.

Member Data Documentation

TextureAtlas* Mezzanine::UI::FontData::Atlas
protected

The Atlas that this GlyphData belongs to.

Definition at line 73 of file font.h.

Real Mezzanine::UI::FontData::BaseLine
protected

The height of the largest glyph in this font.

Definition at line 82 of file font.h.

String Mezzanine::UI::FontData::FontName
protected

The name of this font.

Definition at line 70 of file font.h.

GlyphContainer Mezzanine::UI::FontData::Glyphs
protected

Container storing all the Glyphs contained in this font.

Definition at line 67 of file font.h.

Real Mezzanine::UI::FontData::LetterSpacing
protected

I don't know.

Definition at line 85 of file font.h.

Real Mezzanine::UI::FontData::LineHeight
protected

The height of a line of text in this font.

Definition at line 79 of file font.h.

Real Mezzanine::UI::FontData::SpaceLength
protected

The width in pixels of a space in this font.

Definition at line 76 of file font.h.


The documentation for this class was generated from the following files: