#include <font.h>
Collaboration diagram for kerosin::Font:
Public Member Functions | |
Font (FontServer &fontServer) | |
~Font () | |
bool | Init (const std::string &name, unsigned int size, FT_Face face) |
bool | Bind (int vRows=-1) |
void | Dump () |
void | DrawString (float x, float y, const char *string) |
void | Printf (float x, float y, const char *format,...) |
void | RowPrintf (float x, float row, const char *format,...) |
float | GetStringWidth (const char *string, int numChar=-1) |
! calculates the width of a string, printed with this font. | |
float | GetRowHeight () |
returns the height in pixels of a row | |
const std::string & | GetName () const |
returns the name of the font | |
unsigned int | GetSize () const |
returns the size of the font | |
Private Attributes | |
GlyphMetric | mMetrics [96] |
the metrics of all glyphs | |
unsigned int | mTexID |
OpenGL Texture ID. | |
unsigned int | mRowHeight |
height (in pixels) of a row | |
std::string | mName |
font name | |
unsigned int | mSize |
size of font | |
FontServer & | mFontServer |
reference to the fontserver | |
Classes | |
struct | GlyphMetric |
The font is loaded from Fluid Studios Font Files, which can be generated with a small utility from any Windows font. Care has to be taken, that the resulting font will fit in a 256x256 texture! Our font will only contain characters for the ASCII value range 32-128 ... this should cover the major alphanumeric characters!
NOTE:
HISTORY: 08.10.01 - MK
TODO:
TOFIX:
Definition at line 63 of file font.h.
|
|
|
|
|
Definition at line 204 of file font.cpp. References mRowHeight, and mTexID. |
|
Definition at line 244 of file font.cpp. References kerosin::Font::GlyphMetric::mAdvance, kerosin::Font::GlyphMetric::mByteHeight, kerosin::Font::GlyphMetric::mByteWidth, mMetrics, mRowHeight, kerosin::Font::GlyphMetric::mTC1, kerosin::Font::GlyphMetric::mTC2, kerosin::Font::GlyphMetric::mXOffset, kerosin::Font::GlyphMetric::mYOffset, salt::TVector2< DATATYPE, TYPE >::x(), and salt::TVector2< DATATYPE, TYPE >::y(). Referenced by Printf(), and RowPrintf(). Here is the call graph for this function: ![]() |
|
|
|
returns the name of the font
Definition at line 326 of file font.cpp. References mName. |
|
returns the height in pixels of a row
Definition at line 321 of file font.cpp. References mRowHeight. |
|
returns the size of the font
Definition at line 331 of file font.cpp. References mSize. |
|
! calculates the width of a string, printed with this font. Set numChar to a value between 1 and strlen(string) to calculate intermediate string lengths. A value of -1 (which is the default value) calculates the width if the whole string Definition at line 298 of file font.cpp. References kerosin::Font::GlyphMetric::mAdvance, and mMetrics. |
|
|
Definition at line 278 of file font.cpp. References DrawString(). Here is the call graph for this function: ![]() |
|
Definition at line 288 of file font.cpp. References DrawString(), and mRowHeight. Here is the call graph for this function: ![]() |
|
reference to the fontserver
Definition at line 121 of file font.h. Referenced by Init(). |
|
the metrics of all glyphs
Definition at line 106 of file font.h. Referenced by DrawString(), GetStringWidth(), and Init(). |
|
font name
|
|
height (in pixels) of a row
Definition at line 112 of file font.h. Referenced by Bind(), DrawString(), GetRowHeight(), Init(), and RowPrintf(). |
|
size of font
|
|
OpenGL Texture ID.
|