Skip to content

1681-engine / index / installLabelFont

Function: installLabelFont() ​

ts
function installLabelFont(
   fontFamily, 
   size, 
   color, 
   stroke, 
   strokeWidth, 
   resolution, 
   glyphs?
): string;

Defined in: src/core/BitmapLabel.ts:37

Rasterises one label font once and returns its name. Called ahead of time for the damage numbers: baking a font on its first number froze the first frame that printed one by ~60 ms. glyphs are letters this font bakes besides ASCII and addLabelGlyphs' (a font with its own is a font of its own: pass the same glyphs wherever it is used).

Parameters ​

ParameterTypeDefault value
fontFamilystringundefined
sizenumberundefined
colorstringundefined
strokestringundefined
strokeWidthnumberundefined
resolutionnumberundefined
glyphsstring''

Returns ​

string

Released under the MIT License.