MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
 
typedef std::map< UInt32, Glyph * > GlyphContainer
 
typedef GlyphContainer::iterator GlyphIterator
 

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 _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 GenerateWhitespaceGlyphs ()
 Generates Whitespace Glyphs from this font's data for this font.
 
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

Definition at line 156 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 147 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 150 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 144 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 153 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 141 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 125 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 128 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 116 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 131 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 119 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 113 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 122 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 110 of file font.cpp.

Member Data Documentation

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

The Atlas that this GlyphData belongs to.

Definition at line 71 of file font.h.

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

The height of the largest glyph in this font.

Definition at line 80 of file font.h.

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

The name of this font.

Definition at line 68 of file font.h.

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

Container storing all the Glyphs contained in this font.

Definition at line 65 of file font.h.

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

I don't know.

Definition at line 83 of file font.h.

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

The height of a line of text in this font.

Definition at line 77 of file font.h.

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

The width in pixels of a space in this font.

Definition at line 74 of file font.h.


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