|
Torque2D Reference
|
#include <gFont.h>
Inheritance diagram for GFont:Public Types | |
| enum | Constants { TabWidthInSpaces = 3 , TextureSheetSize = 256 } |
Public Member Functions | |
| GFont () | |
| virtual | ~GFont () |
| TextureHandle | getTextureHandle (S32 index) |
| const PlatformFont::CharInfo & | getCharInfo (const UTF16 in_charIndex) |
| U32 | getCharHeight (const UTF16 in_charIndex) |
| U32 | getCharWidth (const UTF16 in_charIndex) |
| U32 | getCharXIncrement (const UTF16 in_charIndex) |
| 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 *string, U32 strlen, U32 width, bool breakOnWhitespace) |
| U32 | getStrNWidth (const UTF16 *, U32 n) |
| These are the preferred width functions. | |
| U32 | getStrNWidthPrecise (const UTF16 *, U32 n) |
| U32 | getStrWidth (const UTF8 *) |
| These UTF8 versions of the width functions will be deprecated, please avoid them. | |
| U32 | getStrNWidth (const UTF8 *, U32 n) |
| U32 | getStrWidthPrecise (const UTF8 *) |
| U32 | getStrNWidthPrecise (const UTF8 *, U32 n) |
| 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 |
| bool | isAlphaOnly () |
| StringTableEntry | getFontFaceName () const |
| Get the face name of the font. | |
| bool | readBMFont (Stream &io_rStream) |
| bool | read (Stream &io_rStream) |
| bool | write (Stream &io_rStream) |
| void | forcePlatformFont (PlatformFont *pf) |
Public Member Functions inherited from ResourceInstance | |
| ResourceInstance () | |
| virtual | ~ResourceInstance () |
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 |
Friends | |
| ResourceInstance * | constructNewFont (Stream &stream) |
| ResourceInstance * | constructBMFont (Stream &stream) |
Additional Inherited Members | |
Public Attributes inherited from ResourceInstance | |
| ResourceObject * | mSourceResource |
| Pointer to the ResourceObject that stores all our book-keeping data. | |
| enum Constants |
| GFont | ( | ) |
|
virtual |
|
protected |
|
protected |
|
protected |
|
static |
| 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.
|
inline |
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!
|
inline |
|
inline |
| U32 getBreakPos | ( | const UTF16 * | string, |
| U32 | strlen, | ||
| U32 | width, | ||
| bool | breakOnWhitespace | ||
| ) |
|
inline |
| const PlatformFont::CharInfo & getCharInfo | ( | const UTF16 | in_charIndex | ) |
|
inline |
|
inline |
|
static |
|
inline |
|
static |
Get the filename for a cached font.
|
inline |
Get the face name of the font.
|
inline |
| U32 getStrNWidth | ( | const UTF16 * | str, |
| U32 | n | ||
| ) |
These are the preferred width functions.
| U32 getStrNWidth | ( | const UTF8 * | str, |
| U32 | n | ||
| ) |
| U32 getStrNWidthPrecise | ( | const UTF16 * | str, |
| U32 | n | ||
| ) |
| U32 getStrNWidthPrecise | ( | const UTF8 * | str, |
| U32 | n | ||
| ) |
| U32 getStrWidth | ( | const UTF8 * | in_pString | ) |
These UTF8 versions of the width functions will be deprecated, please avoid them.
| U32 getStrWidthPrecise | ( | const UTF8 * | in_pString | ) |
|
inline |
|
inline |
Query as to presence of platform font. If absent, we cannot generate more chars!
| void importStrip | ( | const char * | fileName, |
| U32 | padding, | ||
| U32 | kerning | ||
| ) |
Import an image strip generated with exportStrip, make sure parameters match!
|
inline |
Query to determine if we should use add or modulate (as A8 textures are treated as having 0 for RGB).
|
inline |
|
protected |
| bool read | ( | Stream & | io_rStream | ) |
| bool readBMFont | ( | Stream & | io_rStream | ) |
| void wrapString | ( | const UTF8 * | string, |
| U32 | width, | ||
| Vector< U32 > & | startLineOffset, | ||
| Vector< U32 > & | lineLen | ||
| ) |
| bool write | ( | Stream & | io_rStream | ) |
|
friend |
|
friend |
|
protected |