TorqueScript Reference

- Main Page
- Related Pages
- Modules
- Classes

Functions
Font
Function Categories

## 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 ()

## Detailed Description

## Function Documentation

void dumpFontCacheStatus | ( |  | ) |

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

Returns
  No return value

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

  oldFontName | The original font.
  oldFontSize | The original font's size property.
  newFontName | The name to set the copy to.

Returns
  No return value.

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

  fontName | The name of the font to export.
  size | The size of the font
  fileName | The export file name.
  padding | Desired padding settings.
  kerning | Kerning settings (space between elements)

Returns
  No return value.

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

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

Parameters

  fontName | The name of the font to import.
  size | The size of the font
  fileName | The imported file name.
  padding | Desired padding settings.
  kerning | Kerning settings (space between elements)

Returns
  No return value.

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,rangeEnd | The range of the unicode points to populate caches with

Returns
  No return value

void populateAllFontCacheString | ( | string | inString | ) |

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

Parameters

  inString | The string to use to set the font caches

Returns
  No return value.

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

  faceName | The name of the font
  size | The size of the font.
  rangeStart | The initial Unicode point
  rangeEnd | The final Unicode point in range

Returns
  No return value

void populateFontCacheString | ( | faceName | ,
|  | size | ,
|  | string |
| ) |  |

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

Parameters

  faceName | The font's name
  size | The size of the font.
  string | The string to use to fill font cache

Returns
  No return value.

void writeFontCache | ( |  | ) |

force all cached fonts to serialize themselves to the cache.

Returns
  No return value