7 #ifndef CAFU_FONT_TRUETYPE_HPP_INCLUDED
8 #define CAFU_FONT_TRUETYPE_HPP_INCLUDED
12 #include "Templates/Array.hpp"
15 namespace MatSys {
class RenderMaterialT; }
50 FontInfoT(
const std::string& FontName,
int SizeInPixels_);
80 const std::string&
GetName()
const {
return FontName; }
84 float GetWidth(
const std::string& Text,
float Scale)
const;
94 void Print(
float PosX,
float PosY,
float Scale,
unsigned long Color,
const char* PrintString, ...)
const;
103 const FontInfoT& GetFontInfo(
float Scale)
const;
105 std::string FontName;
106 FontInfoT* FontInfoSmall;
107 FontInfoT* FontInfoMedium;
108 FontInfoT* FontInfoLarge;
109 const float DEFAULT_FONT_SCALE;
float Ascender
The highest coordinate above the baseline in this font face, in pixels.
Definition: FontTT.hpp:56
This class represents a surface render material.
Definition: RenderMaterial.hpp:25
Definition: FontTT.hpp:44
float t1
The t1 tex-coord into the larger bitmap.
Definition: FontTT.hpp:39
float t2
The t2 tex-coord into the larger bitmap.
Definition: FontTT.hpp:41
~FontInfoT()
The destructor.
Definition: FontTT.cpp:131
float BearingX
The horizontal offset of the bitmap relative to the cursor position.
Definition: FontTT.hpp:30
FontInfoT(const std::string &FontName, int SizeInPixels_)
The constructor.
Definition: FontTT.cpp:50
int Width
The width in pixels of the bitmap of this glyph.
Definition: FontTT.hpp:34
ArrayT< MatSys::RenderMaterialT * > RenderMaterials
The render materials matching the Materials array.
Definition: FontTT.hpp:63
MatSys::RenderMaterialT * RM
The RenderMaterialT that represents the larger bitmap that this glyph is embedded in...
Definition: FontTT.hpp:37
float Descender
The lowest coordinate above the baseline in this font face, in pixels.
Definition: FontTT.hpp:57
float Height
The height of this font face, in pixels. Usually larger than Ascender-Descender, as this is to be use...
Definition: FontTT.hpp:58
~TrueTypeFontT()
The destructor.
Definition: FontTT.cpp:157
ArrayT< MaterialT * > Materials
The materials with the larger bitmaps that contain the glyphs.
Definition: FontTT.hpp:62
int Height
The height in pixels of the bitmap of this glyph.
Definition: FontTT.hpp:35
float SizeInPixels
The size of this font in pixels, i.e. 12, 24 or 48.
Definition: FontTT.hpp:55
This class represents a surface material ("A datastructural representation of a scripts material def...
Definition: Material.hpp:22
TrueTypeFontT(const std::string &FontName_)
The constructor.
Definition: FontTT.cpp:141
void Print(float PosX, float PosY, float Scale, unsigned long Color, const char *PrintString,...) const
Prints PrintString at (PosX, PosY) in color Color.
Definition: FontTT.cpp:213
const std::string & GetName() const
Returns the name of this font.
Definition: FontTT.hpp:80
float GetAscender(float Scale) const
Returns how far the highest glyph of this font extends above the baseline ("____") at scale Scale in ...
Definition: FontTT.cpp:197
unsigned long CharToGlyphIndex[256]
Maps each ASCII character to the index into GlyphInfos of its related GlyphInfoT. ...
Definition: FontTT.hpp:59
float BearingY
The vertical offset of the bitmap relative to the cursor position (y-axis points up!).
Definition: FontTT.hpp:31
ArrayT< std::map< int, float > > KerningTable
The kerning table, expressed as a "half-sparse" matrix.
Definition: FontTT.hpp:61
float AdvanceX
How much the cursor position should be advanced horizontally for rendering the next character...
Definition: FontTT.hpp:32
A class for rendering fonts that have been created with the Cafu MakeFont tool.
Definition: FontTT.hpp:22
float GetWidth(const std::string &Text, float Scale) const
Returns the width of string Text at scale Scale in pixels.
Definition: FontTT.cpp:165
float s2
The s2 tex-coord into the larger bitmap.
Definition: FontTT.hpp:40
ArrayT< GlyphInfoT * > GlyphInfos
The GlyphInfos for this font.
Definition: FontTT.hpp:60
float s1
The s1 tex-coord into the larger bitmap.
Definition: FontTT.hpp:38
Definition: FontTT.hpp:26
float GetLineSpacing(float Scale) const
Returns the default line-spacing of this font at scale Scale in pixels.
Definition: FontTT.cpp:205
This is a class for parsing text.
Definition: TextParser.hpp:21