GFont Class Reference#include <gFont.h>
Inheritance diagram for GFont:
[legend]
|
Public Types |
enum | Constants {
TabWidthInSpaces = 3,
TextureSheetSize = 256
} |
Public Member Functions |
| GFont () |
virtual | ~GFont () |
TextureHandle | getTextureHandle (S32 index) const |
const PlatformFont::CharInfo & | getCharInfo (const UTF16 in_charIndex) const |
| While this is const to the outside world, it calls loadCharInfo() to load char info as it is used.
|
U32 | getCharHeight (const UTF16 in_charIndex) const |
U32 | getCharWidth (const UTF16 in_charIndex) const |
U32 | getCharXIncrement (const UTF16 in_charIndex) const |
bool | isValidChar (const UTF16 in_charIndex) const |
const U32 | getHeight () const |
const U32 | getBaseline () const |
const U32 | getAscent () const |
const U32 | getDescent () const |
U32 | getBreakPos (const UTF16 *str16, U32 slen, U32 width, bool breakOnWhitespace) const |
U32 | getStrNWidth (const UTF16 *, U32 n) const |
| These are the preferred width functions.
|
U32 | getStrNWidthPrecise (const UTF16 *, U32 n) const |
U32 | getStrWidth (const UTF8 *) const |
| These UTF8 versions of the width functions will be deprecated, please avoid them.
|
U32 | getStrNWidth (const UTF8 *, U32 n) const |
U32 | getStrWidthPrecise (const UTF8 *) const |
U32 | getStrNWidthPrecise (const UTF8 *, U32 n) const |
void | wrapString (const UTF8 *string, U32 width, Vector< U32 > &startLineOffset, Vector< U32 > &lineLen) |
void | dumpInfo () |
| Dump information about this font to the console.
|
void | exportStrip (const char *fileName, U32 padding, U32 kerning) |
| Export to an image strip for image processing.
|
void | importStrip (const char *fileName, U32 padding, U32 kerning) |
| Import an image strip generated with exportStrip, make sure parameters match!
|
const bool | hasPlatformFont () const |
| Query as to presence of platform font.
|
bool | isAlphaOnly () const |
| Query to determine if we should use add or modulate (as A8 textures are treated as having 0 for RGB).
|
bool | read (Stream &io_rStream) |
bool | write (Stream &io_rStream) |
void | forcePlatformFont (PlatformFont *pf) |
| Override existing platform font if any with a new one from an external source.
|
Static Public Member Functions |
static Resource< GFont > | create (const char *faceName, U32 size, const char *cacheDirectory, U32 charset=TGE_ANSI_CHARSET) |
static const PlatformFont::CharInfo & | getDefaultCharInfo () |
static void | getFontCacheFilename (const char *faceName, U32 faceSize, U32 buffLen, char *outBuff) |
| Get the filename for a cached font.
|
Protected Member Functions |
bool | loadCharInfo (const UTF16 ch) |
void | addBitmap (PlatformFont::CharInfo &charInfo) |
void | addSheet (void) |
void | assignSheet (S32 sheetNum, GBitmap *bmp) |
Protected Attributes |
void * | mMutex |
Private Attributes |
PlatformFont * | mPlatformFont |
Vector< TextureHandle > | mTextureSheets |
S32 | mCurX |
S32 | mCurY |
S32 | mCurSheet |
bool | mNeedSave |
StringTableEntry | mGFTFile |
StringTableEntry | mFaceName |
U32 | mSize |
U32 | mCharSet |
U32 | mHeight |
U32 | mBaseline |
U32 | mAscent |
U32 | mDescent |
Vector< PlatformFont::CharInfo > | mCharInfoList |
S32 | mRemapTable [65536] |
Static Private Attributes |
static const U32 | csm_fileVersion |
static S32 | smSheetIdCount |
Friends |
ResourceInstance * | constructFont (Stream &stream) |
Member Enumeration Documentation
- Enumerator:
-
TabWidthInSpaces |
|
TextureSheetSize |
|
Constructor & Destructor Documentation
virtual GFont::~GFont |
( |
|
) |
[virtual] |
Member Function Documentation
bool GFont::loadCharInfo |
( |
const UTF16 |
ch |
) |
[protected] |
void GFont::addSheet |
( |
void |
|
) |
[protected] |
static Resource<GFont> GFont::create |
( |
const char * |
faceName, |
|
|
U32 |
size, |
|
|
const char * |
cacheDirectory, |
|
|
U32 |
charset = TGE_ANSI_CHARSET | |
|
) |
| | [static] |
TextureHandle GFont::getTextureHandle |
( |
S32 |
index |
) |
const [inline] |
While this is const to the outside world, it calls loadCharInfo() to load char info as it is used.
U32 GFont::getCharHeight |
( |
const UTF16 |
in_charIndex |
) |
const [inline] |
U32 GFont::getCharWidth |
( |
const UTF16 |
in_charIndex |
) |
const [inline] |
U32 GFont::getCharXIncrement |
( |
const UTF16 |
in_charIndex |
) |
const [inline] |
bool GFont::isValidChar |
( |
const UTF16 |
in_charIndex |
) |
const [inline] |
const U32 GFont::getHeight |
( |
|
) |
const [inline] |
const U32 GFont::getBaseline |
( |
|
) |
const [inline] |
const U32 GFont::getAscent |
( |
|
) |
const [inline] |
const U32 GFont::getDescent |
( |
|
) |
const [inline] |
U32 GFont::getBreakPos |
( |
const UTF16 * |
str16, |
|
|
U32 |
slen, |
|
|
U32 |
width, |
|
|
bool |
breakOnWhitespace | |
|
) |
| | const |
U32 GFont::getStrNWidth |
( |
const UTF16 * |
, |
|
|
U32 |
n | |
|
) |
| | const |
These are the preferred width functions.
U32 GFont::getStrNWidthPrecise |
( |
const UTF16 * |
, |
|
|
U32 |
n | |
|
) |
| | const |
U32 GFont::getStrWidth |
( |
const UTF8 * |
|
) |
const |
These UTF8 versions of the width functions will be deprecated, please avoid them.
U32 GFont::getStrNWidth |
( |
const UTF8 * |
, |
|
|
U32 |
n | |
|
) |
| | const |
U32 GFont::getStrWidthPrecise |
( |
const UTF8 * |
|
) |
const |
U32 GFont::getStrNWidthPrecise |
( |
const UTF8 * |
, |
|
|
U32 |
n | |
|
) |
| | const |
Dump information about this font to the console.
void GFont::exportStrip |
( |
const char * |
fileName, |
|
|
U32 |
padding, |
|
|
U32 |
kerning | |
|
) |
| | |
Export to an image strip for image processing.
void GFont::importStrip |
( |
const char * |
fileName, |
|
|
U32 |
padding, |
|
|
U32 |
kerning | |
|
) |
| | |
Import an image strip generated with exportStrip, make sure parameters match!
const bool GFont::hasPlatformFont |
( |
|
) |
const [inline] |
Query as to presence of platform font.
If absent, we cannot generate more chars!
bool GFont::isAlphaOnly |
( |
|
) |
const [inline] |
Query to determine if we should use add or modulate (as A8 textures are treated as having 0 for RGB).
static void GFont::getFontCacheFilename |
( |
const char * |
faceName, |
|
|
U32 |
faceSize, |
|
|
U32 |
buffLen, |
|
|
char * |
outBuff | |
|
) |
| | [static] |
Get the filename for a cached font.
bool GFont::read |
( |
Stream & |
io_rStream |
) |
|
bool GFont::write |
( |
Stream & |
io_rStream |
) |
|
Override existing platform font if any with a new one from an external source.
This is primarily used in font processing tools to enable trickery (ie, putting characters from multiple fonts in a single GFT) and should be used with caution!
Friends And Related Function Documentation
Field Documentation
|