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

Class used to describe a single glyph or character available for text operations. More...

#include <glyph.h>

+ Collaboration diagram for Mezzanine::UI::Glyph:

Public Types

typedef KerningContainer::const_iterator ConstKerningIterator
 Const Iterator type for Kerning information stored in this class.
 
typedef std::vector< KerningInfoKerningContainer
 Container type for Kerning information stored by this class.
 
typedef KerningContainer::iterator KerningIterator
 Iterator type for Kerning information stored in this class.
 
enum  Whitespace {
  HT = 0x0009, LF = 0x000A, VT = 0x000B, CR = 0x000D,
  Space = 0x0020, NEL = 0x0085
}
 This enum represents the common whitespace characters found in Ascii/UTF-8. More...
 

Public Member Functions

 Glyph (FontData *Data)
 Default constructor. More...
 
 Glyph (FontData *Data, TextureAtlas *TexAtlas, const UInt32 &ID, const Real &Advance, const Real &VertOffset)
 Descriptive constructor. More...
 
 ~Glyph ()
 Class destructor.
 
Vector2 GetAtlasCoords (const UI::QuadCorner Corner) const
 Gets the pixel position on the Atlas of a corner belonging to this glyph. More...
 
const StringGetAtlasName () const
 Gets the name of the atlas this glyph belongs to. More...
 
Real GetHeight () const
 Gets the glyphs height on the Texture.
 
Real GetKerning (const UInt32 Previous) const
 Convenience function for getting the Kerning information for a given Glyph. More...
 
Vector2 GetPosition () const
 Gets the position of the glyph on the Texture.
 
Vector2 GetRelativeAtlasCoords (const UI::QuadCorner Corner) const
 Gets the relative position on the Atlas of a corner belonging to this glyph. More...
 
Vector2 GetSize () const
 Gets the size of the glyph on the Texture.
 
Real GetUVBottom () const
 Gets the Bottom coordinate on the Texture.
 
Real GetUVLeft () const
 Gets the Left coordinate on the Texture.
 
Real GetUVRight () const
 Gets the Right coordinate on the Texture.
 
Real GetUVTop () const
 Gets the Top coordinate on the Texture.
 
Real GetWidth () const
 Gets the glyphs width on the Texture.
 
bool IsCarriageReturn () const
 Checks if this glyph is a carriage return.
 
bool IsHorizontalTab () const
 Checks if this glyph is a horizontal tab.
 
bool IsLineFeed () const
 Checks if this glyph is a line feed.
 
bool IsNewLine () const
 Checks if this glyph marks a new line.
 
bool IsNextLine () const
 Checks if this glyph is a next line.
 
bool IsSpace () const
 Checks if this glyph is a space.
 
bool IsTab () const
 Checks if this glyph marks a tab.
 
bool IsVerticalTab () const
 Checks if this glyph is a vertical tab.
 
bool IsWhitespace () const
 Checks if this glyph is not renderable.
 

Public Attributes

TextureAtlasAtlas
 The TextureAtlas this glyph belongs to.
 
Vector2 AtlasCoords [4]
 The 4 corner coordinates on the Texture.
 
FontDataFont
 The collection of glyphs this glyph belongs to.
 
Real GlyphAdvance
 The number of pixels to advance the cursor for the next glyph.
 
UInt32 GlyphID
 The Character this glyph information represents.
 
KerningContainer Kernings
 List of all the Kernings that apply to this glyph.
 
Real VerticalOffset
 The amount of pixels the glyph is to be adjusted on the Y axis.
 

Detailed Description

Class used to describe a single glyph or character available for text operations.

Definition at line 59 of file glyph.h.

Member Enumeration Documentation

This enum represents the common whitespace characters found in Ascii/UTF-8.

Enumerator
HT 

Horizontal Tab.

LF 

Line Feed/Newline.

VT 

Vertical Tab.

CR 

Carriage Return.

Space 

Space.

NEL 

Next Line/Newline.

Definition at line 70 of file glyph.h.

Constructor & Destructor Documentation

Mezzanine::UI::Glyph::Glyph ( FontData Data)
inline

Default constructor.

Parameters
DataThe collection of glyphs this glyph belongs to.

Definition at line 83 of file glyph.h.

Mezzanine::UI::Glyph::Glyph ( FontData Data,
TextureAtlas TexAtlas,
const UInt32 ID,
const Real Advance,
const Real VertOffset 
)
inline

Descriptive constructor.

Parameters
DataThe collection of glyphs this glyph belongs to.
TexAtlasThe TextureAtlas this glyph belongs to.
IDThe Character this glyph information represents.
AdvanceThe number of pixels to advance the cursor for the next glyph.
VertOffsetThe amount of pixels the glyph is to be adjusted on the Y axis.

Definition at line 91 of file glyph.h.

Member Function Documentation

Vector2 Mezzanine::UI::Glyph::GetAtlasCoords ( const UI::QuadCorner  Corner) const
inline

Gets the pixel position on the Atlas of a corner belonging to this glyph.

Parameters
CornerThe corner to retrieve the coordinates for.
Returns
Returns a Vector2 containing the Atlas pixel position of the specific corner.

Definition at line 206 of file glyph.h.

const String& Mezzanine::UI::Glyph::GetAtlasName ( ) const
inline

Gets the name of the atlas this glyph belongs to.

Returns
Returns a string containing the name of the atlas this glyph belongs to.

Definition at line 120 of file glyph.h.

Real Mezzanine::UI::Glyph::GetKerning ( const UInt32  Previous) const
inline

Convenience function for getting the Kerning information for a given Glyph.

Note
This is the character to the left in languages like English(left to right), or the character to the right in languages like Arabic(right to left).
Parameters
PreviousThe previous glyph in the sequence.
Returns
Returns in pixels the special amount to advance.

Definition at line 126 of file glyph.h.

Vector2 Mezzanine::UI::Glyph::GetRelativeAtlasCoords ( const UI::QuadCorner  Corner) const
inline

Gets the relative position on the Atlas of a corner belonging to this glyph.

Parameters
CornerThe corner to retrieve the coordinates for.
Returns
Returns a Vector2 containing the Atlas relative position of the specific corner.

Definition at line 220 of file glyph.h.


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