72 typedef std::shared_ptr<cFont>
cFontPtr;
76 #ifndef DOXYGEN_SHOULD_SKIP_THIS 79 struct cFontCharDescriptor
82 int m_width, m_height;
83 int m_xOffset, m_yOffset;
87 double m_tu0, m_tu1, m_tu2, m_tu3;
88 double m_tv0, m_tv1, m_tv2, m_tv3;
89 double m_px0, m_px1, m_px2, m_px3;
90 double m_py0, m_py1, m_py2, m_py3;
114 unsigned int m_lineHeight;
116 unsigned int m_width, m_height;
117 unsigned int m_pages;
118 std::string m_fileName;
120 cFontCharDescriptor m_chars[256];
135 for (
int i=0; i<256; i++)
136 m_chars[i].initialize();
143 #endif // DOXYGEN_SHOULD_SKIP_THIS 179 static cFontPtr
create() {
return (std::make_shared<cFont>()); }
189 bool loadFromFile(
const std::string& a_filename);
205 double getTextWidth(
const std::string& a_text,
const double a_letterSpacing);
208 double getTextHeight(
const std::string& a_text,
const double a_lineSpacing);
218 double renderText(
const std::string& a_text,
220 const double a_fontScale,
221 const double a_letterSpacing,
222 const double a_lineSpacing,
246 void parseFont(std::istream& a_stream, cFontCharset& a_charsetDesc);
This structures provide a containers for storing rendering options that are passed through the sceneg...
Definition: CRenderOptions.h:82
std::shared_ptr< cFont > cFontPtr
Definition: CFont.h:71
double getPointSize() const
This method returns the current font size.
Definition: CFont.h:202
std::string m_filename
Current font filename loaded into memory.
Definition: CFont.h:259
This class implements support for 2D fonts.
Definition: CFont.h:164
Implements option settings for CHAI3D.
static cFontPtr create()
Shared cFont allocator.
Definition: CFont.h:179
std::string getFilename() const
This method returns the filename from which this font was last loaded or saved.
Definition: CFont.h:192
This class defines a color using a GLfloat representation for each component.
Definition: CColor.h:138
Definition: CAudioBuffer.cpp:56
cFontCharset m_charset
Information about each character in the set.
Definition: CFont.h:236
This class implements a 2D texture map.
Definition: CTexture2d.h:84
cTexture2d * m_texture
Texture image containing the full bitmap representation of the font.
Definition: CFont.h:233