GFont

Engine/source/gfx/gFont.h

More...

Public Types

enum
Constants {
  TabWidthInSpaces = 3
  TextureSheetSize = 256
}

Protected Attributes

Private Static Attributes

Private Attributes

List of character info structures, must be accessed through the getCharInfo(U32) function to account for remapping.

bool
mRemapTable [Font_Table_MAX]

Index remapping.

Public Functions

Dump information about this font to the console.

exportStrip(const char * fileName, U32 padding, U32 kerning)

Export to an image strip for image processing.

getBreakPos(const UTF16 * string, U32 strlen, U32 width, bool breakOnWhitespace)
getCharHeight(const UTF16 in_charIndex)
getCharWidth(const UTF16 in_charIndex)

Get the face name of the font.

These are the preferred width functions.

These UTF8 versions of the width functions will be deprecated, please avoid them.

const bool

Query as to presence of platform font.

importStrip(const char * fileName, U32 padding, U32 kerning)

Import an image strip generated with exportStrip, make sure parameters match!

bool

Query to determine if we should use add or modulate (as A8 textures are treated as having 0 for RGB).

bool
isValidChar(const UTF16 in_charIndex)
bool
read(Stream & io_rStream)
setPlatformFont(PlatformFont * inPlatformFont)
wrapString(const UTF8 * string, U32 width, Vector< U32 > & startLineOffset, Vector< U32 > & lineLen)
bool
write(Stream & io_rStream)

Public Static Functions

create(const String & faceName, U32 size, const char * cacheDirectory, U32 charset)
getFontCacheFilename(const String & faceName, U32 faceSize)

Get the filename for a cached font.

Protected Functions

Detailed Description

Public Types

Constants

Enumerator

TabWidthInSpaces = 3
TextureSheetSize = 256

Protected Attributes

void * mMutex 

Private Static Attributes

const U32 csm_fileVersion 

Private Attributes

U32 mAscent 
U32 mBaseline 
Vector< PlatformFont::CharInfo > mCharInfoList 

List of character info structures, must be accessed through the getCharInfo(U32) function to account for remapping.

U32 mCharSet 
S32 mCurSheet 
S32 mCurX 
S32 mCurY 
U32 mDescent 
String mFaceName 
Torque::Path mGFTFile 
U32 mHeight 
bool mNeedSave 
PlatformFont * mPlatformFont 
S32 mRemapTable [Font_Table_MAX]

Index remapping.

U32 mSize 
Vector< GFXTexHandle > mTextureSheets 

Public Functions

GFont()

~GFont()

dumpInfo()

Dump information about this font to the console.

exportStrip(const char * fileName, U32 padding, U32 kerning)

Export to an image strip for image processing.

getAscent()

getBaseline()

getBreakPos(const UTF16 * string, U32 strlen, U32 width, bool breakOnWhitespace)

getCharHeight(const UTF16 in_charIndex)

getCharInfo(const UTF16 in_charIndex)

getCharWidth(const UTF16 in_charIndex)

getCharXIncrement(const UTF16 in_charIndex)

getDescent()

getFontCharSet()

getFontFaceName()

Get the face name of the font.

getFontSize()

getHeight()

getStrNWidth(const UTF16 * , U32 n)

These are the preferred width functions.

getStrNWidth(const UTF8 * , U32 n)

getStrNWidthPrecise(const UTF16 * , U32 n)

getStrNWidthPrecise(const UTF8 * , U32 n)

getStrWidth(const UTF8 * )

These UTF8 versions of the width functions will be deprecated, please avoid them.

getStrWidthPrecise(const UTF8 * )

getTextureHandle(S32 index)

hasPlatformFont()

Query as to presence of platform font.

If absent, we cannot generate more chars!

importStrip(const char * fileName, U32 padding, U32 kerning)

Import an image strip generated with exportStrip, make sure parameters match!

isAlphaOnly()

Query to determine if we should use add or modulate (as A8 textures are treated as having 0 for RGB).

isValidChar(const UTF16 in_charIndex)

read(Stream & io_rStream)

setPlatformFont(PlatformFont * inPlatformFont)

wrapString(const UTF8 * string, U32 width, Vector< U32 > & startLineOffset, Vector< U32 > & lineLen)

write(Stream & io_rStream)

Public Static Functions

create(const String & faceName, U32 size, const char * cacheDirectory, U32 charset)

getDefaultCharInfo()

getFontCacheFilename(const String & faceName, U32 faceSize)

Get the filename for a cached font.

load(const Torque::Path & path)

Protected Functions

addBitmap(PlatformFont::CharInfo & charInfo)

addSheet(void )

assignSheet(S32 sheetNum, GBitmap * bmp)

loadCharInfo(const UTF16 ch)