TorqueScript Reference
Functions

Functions

void dumpFontCacheStatus ()
 
void duplicateCachedFont (oldFontName, oldFontSize, newFontName)
 
void exportCachedFont (fontName, size, fileName, padding, kerning)
 
void importCachedFont (fontName, size, fileName, padding, kerning)
 
void populateAllFontCacheRange (rangeStart, rangeEnd)
 
void populateAllFontCacheString (string inString)
 
void populateFontCacheRange (faceName, size, rangeStart, rangeEnd)
 
void populateFontCacheString (faceName, size, string)
 
void writeFontCache ()
 
void writeSingleFontCache (fontName)
 

Detailed Description

Function Documentation

◆ dumpFontCacheStatus()

void dumpFontCacheStatus ( )

Dump a full description of all cached fonts, along with info on the codepoints each contains.

Returns
No return value

◆ duplicateCachedFont()

void duplicateCachedFont ( oldFontName  ,
oldFontSize  ,
newFontName   
)

Copy the specified old font to a new name. The new copy will not have a platform font backing it, and so will never have characters added to it. But this is useful for making copies of fonts to add postprocessing effects to via exportCachedFont.

Parameters
oldFontNameThe original font.
oldFontSizeThe original font's size property.
newFontNameThe name to set the copy to.
Returns
No return value.

◆ exportCachedFont()

void exportCachedFont ( fontName  ,
size  ,
fileName  ,
padding  ,
kerning   
)

Export specified font to the specified filename as a PNG. The image can then be processed in Photoshop or another tool and reimported using importCachedFont. Characters in the font are exported as one long strip.

Parameters
fontNameThe name of the font to export.
sizeThe size of the font
fileNameThe export file name.
paddingDesired padding settings.
kerningKerning settings (space between elements)
Returns
No return value.

◆ importCachedFont()

void importCachedFont ( fontName  ,
size  ,
fileName  ,
padding  ,
kerning   
)

Import an image strip from exportCachedFont. Call with the same parameters you called exportCachedFont.

Parameters
fontNameThe name of the font to import.
sizeThe size of the font
fileNameThe imported file name.
paddingDesired padding settings.
kerningKerning settings (space between elements)
Returns
No return value.

◆ populateAllFontCacheRange()

void populateAllFontCacheRange ( rangeStart  ,
rangeEnd   
)

Populate the font cache for all fonts with Unicode code points in the specified range. Note we only support BMP-0, so code points range from 0 to 65535.

Parameters
rangeStart,rangeEndThe range of the unicode points to populate caches with
Returns
No return value

◆ populateAllFontCacheString()

void populateAllFontCacheString ( string  inString)

Populate the font cache for all fonts with characters from the specified string.

Parameters
inStringThe string to use to set the font caches
Returns
No return value.

◆ populateFontCacheRange()

void populateFontCacheRange ( faceName  ,
size  ,
rangeStart  ,
rangeEnd   
)

Populate the font cache for the specified font with Unicode code points in the specified range. Note we only support BMP-0, so code points range from 0 to 65535.

Parameters
faceNameThe name of the font
sizeThe size of the font.
rangeStartThe initial Unicode point
rangeEndThe final Unicode point in range
Returns
No return value

◆ populateFontCacheString()

void populateFontCacheString ( faceName  ,
size  ,
string   
)

Populate the font cache for the specified font with characters from the specified string.

Parameters
faceNameThe font's name
sizeThe size of the font.
stringThe string to use to fill font cache
Returns
No return value.

◆ writeFontCache()

void writeFontCache ( )

force all cached fonts to serialize themselves to the cache.

Returns
No return value

◆ writeSingleFontCache()

void writeSingleFontCache ( fontName  )

Force all cached fonts with a given font name in their paths to serialize themselves to the cache.

Parameters
fontNameThe name of the font to search for in the path. Will save if found.
Returns
No return value