1681-engine / ui / BitmapRichFont
Class: BitmapRichFont ​
Defined in: src/ui/rich/richFonts.ts:116
Runs as BitmapText from label fonts (installLabelFont): changing the text costs no canvas and no upload, and the runs batch. Each colour × size is a font of its own, baked the first time it is used — keep to a few and print each once while loading, or the first line to use one bakes it on that frame. Bitmap fonts have no bold or italic: those tags change nothing here.
Implements ​
Constructors ​
Constructor ​
new BitmapRichFont(options): BitmapRichFont;Defined in: src/ui/rich/richFonts.ts:120
Parameters ​
| Parameter | Type |
|---|---|
options | BitmapRichFontOptions |
Returns ​
BitmapRichFont
Methods ​
ascent() ​
ascent(style): number;Defined in: src/ui/rich/richFonts.ts:131
Baseline from the top of such a line; 0.8 of the line height when not given.
Parameters ​
| Parameter | Type |
|---|---|
style | RichStyle |
Returns ​
number
Implementation of ​
createRun() ​
createRun(): Container;Defined in: src/ui/rich/richFonts.ts:135
A fresh, empty run.
Returns ​
Container
Implementation of ​
lineHeight() ​
lineHeight(style): number;Defined in: src/ui/rich/richFonts.ts:127
Height of a line of text in style.
Parameters ​
| Parameter | Type |
|---|---|
style | RichStyle |
Returns ​
number
Implementation of ​
textWidth() ​
textWidth(text, style): number;Defined in: src/ui/rich/richFonts.ts:122
Advance width of text in style (spaces included: they are measured on their own).
Parameters ​
| Parameter | Type |
|---|---|
text | string |
style | RichStyle |
Returns ​
number
Implementation of ​
updateRun() ​
updateRun(
run,
text,
style
): void;Defined in: src/ui/rich/richFonts.ts:139
Shows text in style on a run made by createRun; cheap when neither changed.
Parameters ​
| Parameter | Type |
|---|---|
run | Container |
text | string |
style | RichStyle |
Returns ​
void