Font
Functions
void
Dumps to the console a full description of all cached fonts, along with info on the codepoints each contains.
void
duplicateCachedFont(string oldFontName, int oldFontSize, string 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.
void
exportCachedFont(string faceName, int fontSize, string fileName, int padding, int 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.
void
importCachedFont(string faceName, int fontSize, string fileName, int padding, int kerning)
Import an image strip from exportCachedFont. Call with the same parameters you called exportCachedFont.
void
populateAllFontCacheRange(uint rangeStart, uint rangeEnd)
Populate the font cache for all fonts with Unicode code points in the specified range.
void
populateAllFontCacheString(string string)
Populate the font cache for all fonts with characters from the specified string.
void
populateFontCacheRange(string faceName, int fontSize, uint rangeStart, uint rangeEnd)
Populate the font cache for the specified font with Unicode code points in the specified range.
void
populateFontCacheString(string faceName, int fontSize, string string)
Populate the font cache for the specified font with characters from the specified string.
void
Force all cached fonts to serialize themselves to the cache.
Detailed Description
Functions
dumpFontCacheStatus()
Dumps to the console a full description of all cached fonts, along with info on the codepoints each contains.
duplicateCachedFont(string oldFontName, int oldFontSize, string 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 name of the font face to copy. |
oldFontSize | The size of the font to copy. |
newFontName | The name of the new font face. |
exportCachedFont(string faceName, int fontSize, string fileName, int padding, int 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:
faceName | The name of the font face. |
fontSize | The size of the font in pixels. |
fileName | The file name and path for the output PNG. |
padding | The padding between characters. |
kerning | The kerning between characters. |
importCachedFont(string faceName, int fontSize, string fileName, int padding, int kerning)
Import an image strip from exportCachedFont. Call with the same parameters you called exportCachedFont.
Parameters:
faceName | The name of the font face. |
fontSize | The size of the font in pixels. |
fileName | The file name and path for the input PNG. |
padding | The padding between characters. |
kerning | The kerning between characters. |
populateAllFontCacheRange(uint rangeStart, uint rangeEnd)
Populate the font cache for all fonts with Unicode code points in the specified range.
Parameters:
rangeStart | The start Unicode point. |
rangeEnd | The end Unicode point. |
note:We only support BMP-0, so code points range from 0 to 65535.
populateAllFontCacheString(string string)
Populate the font cache for all fonts with characters from the specified string.
populateFontCacheRange(string faceName, int fontSize, uint rangeStart, uint rangeEnd)
Populate the font cache for the specified font with Unicode code points in the specified range.
Parameters:
faceName | The name of the font face. |
fontSize | The size of the font in pixels. |
rangeStart | The start Unicode point. |
rangeEnd | The end Unicode point. |
note:We only support BMP-0, so code points range from 0 to 65535.
populateFontCacheString(string faceName, int fontSize, string string)
Populate the font cache for the specified font with characters from the specified string.
Parameters:
faceName | The name of the font face. |
fontSize | The size of the font in pixels. |
string | The string to populate. |
writeFontCache()
Force all cached fonts to serialize themselves to the cache.