#include <llfont.h>
Public Types | |
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 |
Definition at line 94 of file llfont.h.
typedef std::map<llwchar, LLFontGlyphInfo*> LLFont::char_glyph_info_map_t [protected] |
anonymous enum |
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.
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] |
Reimplemented in LLFontGL.
Definition at line 183 of file llfont.cpp.
References addGlyph(), 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(), and LLFontGL::loadFaceFallback().
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().
F32 LLFont::getLineHeight | ( | ) | const [virtual] |
F32 LLFont::getAscenderHeight | ( | ) | const [virtual] |
F32 LLFont::getDescenderHeight | ( | ) | const [virtual] |
const LLFontGlyphInfo& LLFont::getMetrics | ( | 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().
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().
Definition at line 326 of file llfont.cpp.
References FALSE, getGlyphInfo(), llassert, mIsFallback, LLFontGlyphInfo::mIsRendered, and TRUE.
Referenced by LLFontGL::render().
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().
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, 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(), and TRUE.
Referenced by addChar(), and addGlyph().
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().
void LLFont::insertGlyphInfo | ( | llwchar | wch, | |
LLFontGlyphInfo * | gi | |||
) | const [protected] |
Definition at line 381 of file llfont.cpp.
References mCharGlyphInfoMap.
Referenced by addGlyphFromFont(), and getXAdvance().
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, mCurrentOffsetY, and mRawImagep.
Referenced by addGlyphFromFont(), and LLFontGL::reset().
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, and mRawImagep.
Referenced by addGlyphFromFont().
std::string LLFont::mName [protected] |
F32 LLFont::mAscender [protected] |
Definition at line 161 of file llfont.h.
Referenced by LLFontGL::drawGlyph(), LLFontGL::getAscenderHeight(), getAscenderHeight(), LLFont(), loadFace(), and LLFontGL::render().
F32 LLFont::mDescender [protected] |
Definition at line 162 of file llfont.h.
Referenced by LLFontGL::getDescenderHeight(), getDescenderHeight(), LLFont(), loadFace(), and LLFontGL::render().
F32 LLFont::mLineHeight [protected] |
Definition at line 163 of file llfont.h.
Referenced by LLFontGL::getLineHeight(), getLineHeight(), LLFont(), loadFace(), and LLFontGL::render().
S32 LLFont::mNumComponents [protected] |
Definition at line 165 of file llfont.h.
Referenced by addGlyphFromFont(), LLFont(), and loadFace().
S32 LLFont::mBitmapWidth [protected] |
S32 LLFont::mBitmapHeight [protected] |
Definition at line 167 of file llfont.h.
Referenced by addGlyphFromFont(), LLFont(), and loadFace().
S32 LLFont::mMaxCharWidth [protected] |
S32 LLFont::mMaxCharHeight [protected] |
Definition at line 169 of file llfont.h.
Referenced by addGlyphFromFont(), LLFont(), and loadFace().
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().
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().
LLFontList* LLFont::mFallbackFontp [protected] |
Definition at line 176 of file llfont.h.
Referenced by addChar(), getXAdvance(), LLFont(), and setFallbackFont().
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().
BOOL LLFont::mValid [protected] |
LLPointer<LLImageRaw> LLFont::mRawImagep [private] |
Definition at line 190 of file llfont.h.
Referenced by addGlyphFromFont(), loadFace(), resetBitmap(), setRawImage(), setSubImageLuminanceAlpha(), and ~LLFont().