GLFont2d Class Reference

#include <GLFont2d.h>

List of all members.

Public Member Functions

 GLFont2d ()
 ~GLFont2d ()
bool createFont (const std::string &typeFace, unsigned int h, bool makeShadow=false)
void draw (Vector &color, float size, float x, float y, float z, const LangString &text)
void drawA (Vector &color, float alpha, float size, float x, float y, float z, const LangString &text)
void drawA (GLFont2dI *handler, Vector &color, float alpha, float size, float x, float y, float z, const LangString &text)
void drawWidth (float width, Vector &color, float size, float x, float y, float z, const LangString &text)
void drawWidthRhs (float width, Vector &color, float size, float x, float y, float z, const LangString &text)
void drawSubStr (int start, int len, Vector &color, float size, float x, float y, float z, const LangString &text)
void drawSubStrA (int start, int len, Vector &color, float alpha, float size, float x, float y, float z, const LangString &text)
void drawBilboard (Vector &color, float alpha, float size, float x, float y, float z, const LangString &text)
float getWidth (float size, const LangString &text, int len=0)
int getChars (float size, const LangString &text, float width)
void draw (Vector &color, float size, float x, float y, float z, const std::string &text)
void drawA (Vector &color, float alpha, float size, float x, float y, float z, const std::string &text)
void drawA (GLFont2dI *handler, Vector &color, float alpha, float size, float x, float y, float z, const std::string &text)
void drawWidth (float width, Vector &color, float size, float x, float y, float z, const std::string &text)
void drawWidthRhs (float width, Vector &color, float size, float x, float y, float z, const std::string &text)
void drawSubStr (int start, int len, Vector &color, float size, float x, float y, float z, const std::string &text)
void drawSubStrA (int start, int len, Vector &color, float alpha, float size, float x, float y, float z, const std::string &text)
void drawBilboard (Vector &color, float alpha, float size, float x, float y, float z, const std::string &text)
float getWidth (float size, const std::string &text, int len=0)
int getChars (float size, const std::string &text, float width)

Static Public Member Functions

static unsigned int getTotalCharacters ()

Protected Member Functions

GLFont2dStorage::CharEntrygetCharacter (unsigned int character)
void drawLetter (GLFont2dStorage::CharEntry *entry)
bool drawString (unsigned len, Vector &color, float alpha, float size, float x, float y, float z, const unsigned int *string, bool bilboard)
bool drawStringHandler (unsigned length, GLFont2dI *handler, Vector &color, float alpha, float size, float x, float y, float z, const unsigned int *string)

Protected Attributes

GLFont2dFreeTypefreetype_
GLFont2dStorage characters_
LangString langText_
float height_

Static Protected Attributes

static unsigned int totalCharacters_


Detailed Description

Definition at line 31 of file GLFont2d.h.


Constructor & Destructor Documentation

GLFont2d::GLFont2d (  ) 

Definition at line 30 of file GLFont2d.cpp.

References freetype_.

GLFont2d::~GLFont2d (  ) 

Definition at line 35 of file GLFont2d.cpp.

References freetype_.


Member Function Documentation

bool GLFont2d::createFont ( const std::string typeFace,
unsigned int  h,
bool  makeShadow = false 
)

Definition at line 354 of file GLFont2d.cpp.

References GLFont2dFreeType::createFont(), freetype_, and height_.

Referenced by GLWFont::GLWFont().

void GLFont2d::draw ( Vector color,
float  size,
float  x,
float  y,
float  z,
const LangString text 
)

Definition at line 65 of file GLFont2d.cpp.

References drawString().

Referenced by ScoreDialog::addLine(), ScoreDialog::addScoreLine(), SpeedChange::draw(), ShotCountDown::draw(), GLWSpinBox::draw(), GLWSelectorPart::draw(), GLWScorchedInfo::draw(), GLWLabel::draw(), draw(), StartDialog::draw(), ScoreDialog::draw(), MessageDialog::draw(), BuyAccessoryDialog::draw(), ConsoleLine::drawLine(), RulesDialog::drawRules(), ConsoleImpl::drawText(), and TargetRendererImplTank::render2D().

void GLFont2d::drawA ( Vector color,
float  alpha,
float  size,
float  x,
float  y,
float  z,
const LangString text 
)

Definition at line 72 of file GLFont2d.cpp.

References drawString().

Referenced by GLWToolTip::draw(), and drawA().

void GLFont2d::drawA ( GLFont2dI handler,
Vector color,
float  alpha,
float  size,
float  x,
float  y,
float  z,
const LangString text 
)

Definition at line 79 of file GLFont2d.cpp.

References drawStringHandler().

void GLFont2d::drawWidth ( float  width,
Vector color,
float  size,
float  x,
float  y,
float  z,
const LangString text 
)

Definition at line 113 of file GLFont2d.cpp.

References drawString(), and getChars().

Referenced by ScoreDialog::addLine(), GLWTextBox::draw(), GLWFileView::draw(), GLWDropDownText::draw(), SettingsSubSelectDialogListItem::draw(), GLWIconListSaveItem::draw(), ProgressDialog::draw(), GLWIconListSubModItem::draw(), GLWIconListModItem::draw(), AdminDialog::drawColumn(), NetworkSelectDialog::drawColumnGames(), NetworkSelectDialog::drawColumnPlayers(), and drawWidth().

void GLFont2d::drawWidthRhs ( float  width,
Vector color,
float  size,
float  x,
float  y,
float  z,
const LangString text 
)

Definition at line 121 of file GLFont2d.cpp.

References GLFont2dStorage::CharEntry::advances, drawString(), getCharacter(), and height_.

Referenced by GLWTalkBox::draw(), GLWChannelText::draw(), and drawWidthRhs().

void GLFont2d::drawSubStr ( int  start,
int  len,
Vector color,
float  size,
float  x,
float  y,
float  z,
const LangString text 
)

Definition at line 86 of file GLFont2d.cpp.

References drawSubStrA().

Referenced by GLWTime::draw(), GLWListView::draw(), and drawSubStr().

void GLFont2d::drawSubStrA ( int  start,
int  len,
Vector color,
float  alpha,
float  size,
float  x,
float  y,
float  z,
const LangString text 
)

Definition at line 94 of file GLFont2d.cpp.

References GLFont2dStorage::CharEntry::advances, drawString(), getCharacter(), and height_.

Referenced by drawSubStr(), and drawSubStrA().

void GLFont2d::drawBilboard ( Vector color,
float  alpha,
float  size,
float  x,
float  y,
float  z,
const LangString text 
)

Definition at line 142 of file GLFont2d.cpp.

References drawString().

Referenced by TextActionRenderer::draw(), drawBilboard(), TargetRendererImplTank::drawInfo(), and LandVisibilityPatch::drawLODLevel().

float GLFont2d::getWidth ( float  size,
const LangString text,
int  len = 0 
)

Definition at line 40 of file GLFont2d.cpp.

References GLFont2dStorage::CharEntry::advances, getCharacter(), height_, and int().

Referenced by GLWSelectorPart::calculateDimensions(), GLWTime::calcWidth(), GLWLabel::calcWidth(), ShotCountDown::draw(), GLWScorchedInfo::draw(), GLWListView::draw(), GLWChannelText::draw(), StartDialog::draw(), ScoreDialog::draw(), MessageDialog::draw(), TargetRendererImplTank::drawInfo(), GLWListView::drawUrl(), and getWidth().

int GLFont2d::getChars ( float  size,
const LangString text,
float  width 
)

Definition at line 53 of file GLFont2d.cpp.

References GLFont2dStorage::CharEntry::advances, getCharacter(), and height_.

Referenced by GLWListView::draw(), drawWidth(), and getChars().

void GLFont2d::draw ( Vector color,
float  size,
float  x,
float  y,
float  z,
const std::string text 
)

Definition at line 161 of file GLFont2d.cpp.

References draw(), langText_, and LangStringUtil::replaceToLang().

void GLFont2d::drawA ( Vector color,
float  alpha,
float  size,
float  x,
float  y,
float  z,
const std::string text 
)

Definition at line 169 of file GLFont2d.cpp.

References drawA(), langText_, and LangStringUtil::replaceToLang().

void GLFont2d::drawA ( GLFont2dI handler,
Vector color,
float  alpha,
float  size,
float  x,
float  y,
float  z,
const std::string text 
)

Definition at line 177 of file GLFont2d.cpp.

References drawA(), langText_, and LangStringUtil::replaceToLang().

void GLFont2d::drawWidth ( float  width,
Vector color,
float  size,
float  x,
float  y,
float  z,
const std::string text 
)

Definition at line 185 of file GLFont2d.cpp.

References drawWidth(), langText_, and LangStringUtil::replaceToLang().

void GLFont2d::drawWidthRhs ( float  width,
Vector color,
float  size,
float  x,
float  y,
float  z,
const std::string text 
)

Definition at line 194 of file GLFont2d.cpp.

References drawWidthRhs(), langText_, and LangStringUtil::replaceToLang().

void GLFont2d::drawSubStr ( int  start,
int  len,
Vector color,
float  size,
float  x,
float  y,
float  z,
const std::string text 
)

Definition at line 203 of file GLFont2d.cpp.

References drawSubStr(), langText_, and LangStringUtil::replaceToLang().

void GLFont2d::drawSubStrA ( int  start,
int  len,
Vector color,
float  alpha,
float  size,
float  x,
float  y,
float  z,
const std::string text 
)

Definition at line 212 of file GLFont2d.cpp.

References drawSubStrA(), langText_, and LangStringUtil::replaceToLang().

void GLFont2d::drawBilboard ( Vector color,
float  alpha,
float  size,
float  x,
float  y,
float  z,
const std::string text 
)

Definition at line 221 of file GLFont2d.cpp.

References drawBilboard(), langText_, and LangStringUtil::replaceToLang().

float GLFont2d::getWidth ( float  size,
const std::string text,
int  len = 0 
)

Definition at line 149 of file GLFont2d.cpp.

References getWidth(), langText_, and LangStringUtil::replaceToLang().

int GLFont2d::getChars ( float  size,
const std::string text,
float  width 
)

Definition at line 155 of file GLFont2d.cpp.

References getChars(), langText_, and LangStringUtil::replaceToLang().

static unsigned int GLFont2d::getTotalCharacters (  )  [inline, static]

Definition at line 103 of file GLFont2d.h.

References totalCharacters_.

Referenced by GLWFont::displayCharacterInfo().

GLFont2dStorage::CharEntry * GLFont2d::getCharacter ( unsigned int  character  )  [protected]

Definition at line 342 of file GLFont2d.cpp.

References characters_, GLFont2dFreeType::createCharacter(), GLFont2dStorage::CharEntry::displaylist, freetype_, GLFont2dStorage::getEntry(), and totalCharacters_.

Referenced by drawString(), drawStringHandler(), drawSubStrA(), drawWidthRhs(), getChars(), and getWidth().

void GLFont2d::drawLetter ( GLFont2dStorage::CharEntry entry  )  [protected]

Definition at line 229 of file GLFont2d.cpp.

References GLFont2dStorage::CharEntry::advances, GLCameraFrustum::getBilboardVectorX(), GLCameraFrustum::getBilboardVectorY(), GL_QUADS, GL_TEXTURE_2D, glBegin(), glBindTexture(), glEnd(), glPopMatrix(), glPushMatrix(), glTexCoord2f(), glTranslatef(), glVertex3f(), glVertex3fv(), GLFont2dStorage::CharEntry::height, GLCameraFrustum::instance(), GLFont2dStorage::CharEntry::left, GLFont2dStorage::CharEntry::rows, GLFont2dStorage::CharEntry::texture, GLFont2dStorage::CharEntry::width, GLFont2dStorage::CharEntry::x, and GLFont2dStorage::CharEntry::y.

Referenced by drawString().

bool GLFont2d::drawString ( unsigned  len,
Vector color,
float  alpha,
float  size,
float  x,
float  y,
float  z,
const unsigned int *  string,
bool  bilboard 
) [protected]

Definition at line 299 of file GLFont2d.cpp.

References GLState::BLEND_ON, GLFont2dStorage::CharEntry::displaylist, drawLetter(), getCharacter(), GL_UNSIGNED_INT, glCallLists(), glColor4f(), glPopMatrix(), glPushMatrix(), glScalef(), glTranslatef(), height_, GLTextureBase::setLastBind(), and GLState::TEXTURE_ON.

Referenced by draw(), drawA(), drawBilboard(), drawSubStrA(), drawWidth(), and drawWidthRhs().

bool GLFont2d::drawStringHandler ( unsigned  length,
GLFont2dI handler,
Vector color,
float  alpha,
float  size,
float  x,
float  y,
float  z,
const unsigned int *  string 
) [protected]

Definition at line 260 of file GLFont2d.cpp.

References GLFont2dStorage::CharEntry::advances, GLState::BLEND_ON, GLFont2dStorage::CharEntry::displaylist, GLFont2dI::drawCharacter(), getCharacter(), glCallList(), glColor4fv(), glPopMatrix(), glPushMatrix(), glScalef(), glTranslatef(), height_, GLTextureBase::setLastBind(), and GLState::TEXTURE_ON.

Referenced by drawA().


Member Data Documentation

unsigned int GLFont2d::totalCharacters_ [static, protected]

Definition at line 106 of file GLFont2d.h.

Referenced by getCharacter(), and getTotalCharacters().

GLFont2dFreeType* GLFont2d::freetype_ [protected]

Definition at line 107 of file GLFont2d.h.

Referenced by createFont(), getCharacter(), GLFont2d(), and ~GLFont2d().

GLFont2dStorage GLFont2d::characters_ [protected]

Definition at line 108 of file GLFont2d.h.

Referenced by getCharacter().

LangString GLFont2d::langText_ [protected]

Definition at line 109 of file GLFont2d.h.

Referenced by draw(), drawA(), drawBilboard(), drawSubStr(), drawSubStrA(), drawWidth(), drawWidthRhs(), getChars(), and getWidth().

float GLFont2d::height_ [protected]

Definition at line 110 of file GLFont2d.h.

Referenced by createFont(), drawString(), drawStringHandler(), drawSubStrA(), drawWidthRhs(), getChars(), and getWidth().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:01 2009 for Scorched3D by  doxygen 1.5.3