LLFont Class Reference

#include <llfont.h>

Inheritance diagram for LLFont:

Inheritance graph
[legend]
Collaboration diagram for LLFont:

Collaboration graph
[legend]
List of all members.

Public Types

 FIRST_CHAR = 32
 NUM_CHARS = 127 - 32
 LAST_CHAR_BASIC = 127
 NUM_CHARS_FULL = 255 - 32
 LAST_CHAR_FULL = 255
enum  {
  FIRST_CHAR = 32, NUM_CHARS = 127 - 32, LAST_CHAR_BASIC = 127, NUM_CHARS_FULL = 255 - 32,
  LAST_CHAR_FULL = 255
}

Public Member Functions

 LLFont (LLImageRaw *imagep=NULL)
virtual ~LLFont ()
virtual BOOL loadFace (const std::string &filename, const F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback)
void setFallbackFont (LLFontList *fontp)
void setCharToGlyphMap (llwchar wch, U32 glyph_index) const
void setRawImage (LLImageRaw *imagep)
virtual F32 getLineHeight () const
virtual F32 getAscenderHeight () const
virtual F32 getDescenderHeight () const
const LLFontGlyphInfo & getMetrics (const llwchar wc) const
F32 getXAdvance (const llwchar wc) const
F32 getXKerning (const llwchar char_left, const llwchar char_right) const

Protected Types

typedef std::map< llwchar,
LLFontGlyphInfo * > 
char_glyph_info_map_t

Protected Member Functions

virtual BOOL hasGlyph (const llwchar wch) const
virtual BOOL addChar (const llwchar wch)
virtual BOOL addGlyph (const llwchar wch, const U32 glyph_index)
virtual BOOL addGlyphFromFont (LLFont *fontp, const llwchar wch, const U32 glyph_index)
virtual LLFontGlyphInfo * getGlyphInfo (const llwchar wch) const
void insertGlyphInfo (llwchar wch, LLFontGlyphInfo *gi) const
void renderGlyph (const U32 glyph_index)
void resetBitmap ()
void setSubImageLuminanceAlpha (const U32 x, const U32 y, const U32 width, const U32 height, const U8 *data, S32 stride=0)

Protected Attributes

std::string mName
F32 mAscender
F32 mDescender
F32 mLineHeight
S32 mNumComponents
S32 mBitmapWidth
S32 mBitmapHeight
S32 mMaxCharWidth
S32 mMaxCharHeight
S32 mCurrentOffsetX
S32 mCurrentOffsetY
LLFT_Face mFTFace
BOOL mIsFallback
LLFontList * mFallbackFontp
char_glyph_info_map_t mCharGlyphInfoMap
BOOL mValid

Private Attributes

LLPointer< LLImageRaw > mRawImagep

Detailed Description

Definition at line 94 of file llfont.h.


Member Typedef Documentation

typedef std::map<llwchar, LLFontGlyphInfo*> LLFont::char_glyph_info_map_t [protected]

Definition at line 178 of file llfont.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
FIRST_CHAR 
NUM_CHARS 
LAST_CHAR_BASIC 
NUM_CHARS_FULL 
LAST_CHAR_FULL 

Definition at line 133 of file llfont.h.


Constructor & Destructor Documentation

LLFont::LLFont ( LLImageRaw *  imagep = NULL  ) 

Definition at line 127 of file llfont.cpp.

References FALSE, mAscender, mBitmapHeight, mBitmapWidth, mCurrentOffsetX, mCurrentOffsetY, mDescender, mFallbackFontp, mFTFace, mIsFallback, mLineHeight, mMaxCharHeight, mMaxCharWidth, mNumComponents, mValid, and NULL.

Referenced by LLFontGL::loadFaceFallback().

LLFont::~LLFont (  )  [virtual]

Definition at line 147 of file llfont.cpp.

References mCharGlyphInfoMap, mFTFace, mRawImagep, and NULL.


Member Function Documentation

BOOL LLFont::addChar ( const llwchar  wch  )  [protected, virtual]

Reimplemented in LLFontGL.

Definition at line 340 of file llfont.cpp.

References addGlyph(), addGlyphFromFont(), FALSE, llassert, mCharGlyphInfoMap, mFallbackFontp, mFTFace, mIsFallback, NULL, and TRUE.

Referenced by LLFontGL::addChar().

BOOL LLFont::addGlyph ( const llwchar  wch,
const U32  glyph_index 
) [protected, virtual]

Definition at line 515 of file llfont.cpp.

References addGlyphFromFont().

Referenced by addChar(), loadFace(), and resetBitmap().

BOOL LLFont::addGlyphFromFont ( LLFont *  fontp,
const llwchar  wch,
const U32  glyph_index 
) [protected, virtual]

Definition at line 395 of file llfont.cpp.

References FALSE, height, insertGlyphInfo(), llassert, mBitmapHeight, mCurrentOffsetX, mCurrentOffsetY, mFTFace, LLFontGlyphInfo::mHeight, mIsFallback, LLFontGlyphInfo::mIsRendered, mMaxCharHeight, mNumComponents, mRawImagep, LLFontGlyphInfo::mWidth, LLFontGlyphInfo::mXAdvance, LLFontGlyphInfo::mXBearing, LLFontGlyphInfo::mXBitmapOffset, LLFontGlyphInfo::mYAdvance, LLFontGlyphInfo::mYBearing, LLFontGlyphInfo::mYBitmapOffset, NULL, renderGlyph(), resetBitmap(), S32, setSubImageLuminanceAlpha(), TRUE, and width.

Referenced by addChar(), and addGlyph().

F32 LLFont::getAscenderHeight (  )  const [virtual]

Reimplemented in LLFontGL.

Definition at line 172 of file llfont.cpp.

References mAscender.

F32 LLFont::getDescenderHeight (  )  const [virtual]

Reimplemented in LLFontGL.

Definition at line 178 of file llfont.cpp.

References mDescender.

LLFontGlyphInfo * LLFont::getGlyphInfo ( const llwchar  wch  )  const [protected, virtual]

Definition at line 315 of file llfont.cpp.

References mCharGlyphInfoMap, and NULL.

Referenced by getXAdvance(), hasGlyph(), and LLFontGL::render().

F32 LLFont::getLineHeight (  )  const [virtual]

Reimplemented in LLFontGL.

Definition at line 166 of file llfont.cpp.

References mLineHeight.

const LLFontGlyphInfo& LLFont::getMetrics ( const llwchar  wc  )  const

F32 LLFont::getXAdvance ( const llwchar  wc  )  const

Definition at line 521 of file llfont.cpp.

References get_if_there(), getGlyphInfo(), insertGlyphInfo(), llassert, mCharGlyphInfoMap, mFallbackFontp, mFTFace, LLFontGlyphInfo::mHeight, mIsFallback, LLFontGlyphInfo::mIsRendered, mMaxCharWidth, LLFontGlyphInfo::mWidth, LLFontGlyphInfo::mXAdvance, LLFontGlyphInfo::mYAdvance, NULL, and renderGlyph().

Referenced by LLFontGL::charFromPixelOffset(), LLFontGL::firstDrawableChar(), LLFontGL::getWidthF32(), and LLFontGL::maxDrawableChars().

F32 LLFont::getXKerning ( const llwchar  char_left,
const llwchar  char_right 
) const

Definition at line 605 of file llfont.cpp.

References get_if_there(), llassert, llverify, mCharGlyphInfoMap, mFTFace, LLFontGlyphInfo::mGlyphIndex, mIsFallback, and NULL.

Referenced by LLFontGL::charFromPixelOffset(), LLFontGL::firstDrawableChar(), LLFontGL::getWidthF32(), LLFontGL::maxDrawableChars(), and LLFontGL::render().

BOOL LLFont::hasGlyph ( const llwchar  wch  )  const [protected, virtual]

Definition at line 326 of file llfont.cpp.

References FALSE, getGlyphInfo(), llassert, mIsFallback, LLFontGlyphInfo::mIsRendered, and TRUE.

Referenced by LLFontGL::render().

void LLFont::insertGlyphInfo ( llwchar  wch,
LLFontGlyphInfo *  gi 
) const [protected]

Definition at line 381 of file llfont.cpp.

References mCharGlyphInfoMap.

Referenced by addGlyphFromFont(), and getXAdvance().

BOOL LLFont::loadFace ( const std::string &  filename,
const F32  point_size,
const F32  vert_dpi,
const F32  horz_dpi,
const S32  components,
BOOL  is_fallback 
) [virtual]

Definition at line 183 of file llfont.cpp.

References addGlyph(), f, FALSE, gFTLibrary, LLPointer< Type >::isNull(), llmin(), llround(), mAscender, mBitmapHeight, mBitmapWidth, mCurrentOffsetX, mCurrentOffsetY, mDescender, mFTFace, mIsFallback, mLineHeight, mMaxCharHeight, mMaxCharWidth, mName, mNumComponents, mRawImagep, NULL, S32, and TRUE.

Referenced by LLFontGL::loadFace().

void LLFont::renderGlyph ( const U32  glyph_index  )  [protected]

Definition at line 592 of file llfont.cpp.

References gFontRenderMode, llassert, mFTFace, and NULL.

Referenced by addGlyphFromFont(), and getXAdvance().

void LLFont::resetBitmap (  )  [protected]

Definition at line 297 of file llfont.cpp.

References addGlyph(), FALSE, llendl, llinfos, mCharGlyphInfoMap, mCurrentOffsetX, and mCurrentOffsetY.

Referenced by addGlyphFromFont(), and LLFontGL::reset().

void LLFont::setCharToGlyphMap ( llwchar  wch,
U32  glyph_index 
) const

void LLFont::setFallbackFont ( LLFontList *  fontp  )  [inline]

Definition at line 107 of file llfont.h.

References mFallbackFontp.

Referenced by LLFontGL::loadFace().

void LLFont::setRawImage ( LLImageRaw *  imagep  ) 

Definition at line 160 of file llfont.cpp.

References mRawImagep.

Referenced by LLFontGL::init().

void LLFont::setSubImageLuminanceAlpha ( const U32  x,
const U32  y,
const U32  width,
const U32  height,
const U8 *  data,
S32  stride = 0 
) [protected]

Definition at line 624 of file llfont.cpp.

References i, j, llassert, mIsFallback, mRawImagep, and target.

Referenced by addGlyphFromFont().


Member Data Documentation

F32 LLFont::mAscender [protected]

Definition at line 161 of file llfont.h.

Referenced by LLFontGL::drawGlyph(), LLFontGL::getAscenderHeight(), getAscenderHeight(), LLFont(), loadFace(), and LLFontGL::render().

S32 LLFont::mBitmapHeight [protected]

Definition at line 167 of file llfont.h.

Referenced by addGlyphFromFont(), LLFont(), and loadFace().

S32 LLFont::mBitmapWidth [protected]

Definition at line 166 of file llfont.h.

Referenced by LLFont(), and loadFace().

char_glyph_info_map_t LLFont::mCharGlyphInfoMap [mutable, protected]

Definition at line 179 of file llfont.h.

Referenced by addChar(), getGlyphInfo(), getXAdvance(), getXKerning(), insertGlyphInfo(), resetBitmap(), and ~LLFont().

S32 LLFont::mCurrentOffsetX [protected]

Definition at line 170 of file llfont.h.

Referenced by addGlyphFromFont(), LLFont(), loadFace(), and resetBitmap().

S32 LLFont::mCurrentOffsetY [protected]

Definition at line 171 of file llfont.h.

Referenced by addGlyphFromFont(), LLFont(), loadFace(), and resetBitmap().

F32 LLFont::mDescender [protected]

Definition at line 162 of file llfont.h.

Referenced by LLFontGL::getDescenderHeight(), getDescenderHeight(), LLFont(), loadFace(), and LLFontGL::render().

LLFontList* LLFont::mFallbackFontp [protected]

Definition at line 176 of file llfont.h.

Referenced by addChar(), getXAdvance(), LLFont(), and setFallbackFont().

LLFT_Face LLFont::mFTFace [protected]

Definition at line 173 of file llfont.h.

Referenced by addChar(), addGlyphFromFont(), getXAdvance(), getXKerning(), LLFont(), loadFace(), renderGlyph(), and ~LLFont().

BOOL LLFont::mIsFallback [protected]

Definition at line 175 of file llfont.h.

Referenced by addChar(), addGlyphFromFont(), getXAdvance(), getXKerning(), hasGlyph(), LLFont(), loadFace(), and setSubImageLuminanceAlpha().

F32 LLFont::mLineHeight [protected]

Definition at line 163 of file llfont.h.

Referenced by LLFontGL::getLineHeight(), getLineHeight(), LLFont(), loadFace(), and LLFontGL::render().

S32 LLFont::mMaxCharHeight [protected]

Definition at line 169 of file llfont.h.

Referenced by addGlyphFromFont(), LLFont(), and loadFace().

S32 LLFont::mMaxCharWidth [protected]

Definition at line 168 of file llfont.h.

Referenced by getXAdvance(), LLFont(), and loadFace().

std::string LLFont::mName [protected]

Definition at line 160 of file llfont.h.

Referenced by loadFace().

S32 LLFont::mNumComponents [protected]

Definition at line 165 of file llfont.h.

Referenced by addGlyphFromFont(), LLFont(), and loadFace().

LLPointer<LLImageRaw> LLFont::mRawImagep [private]

Definition at line 190 of file llfont.h.

Referenced by addGlyphFromFont(), loadFace(), setRawImage(), setSubImageLuminanceAlpha(), and ~LLFont().

BOOL LLFont::mValid [protected]

Definition at line 181 of file llfont.h.

Referenced by LLFont().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:22 2010 for Second Life Viewer by  doxygen 1.4.7