Documentation / @finchart/core / index / applyFont
Function: applyFont()
applyFont(
context,font,fallback,verdicts?):string
Defined in: packages/core/src/render/canvas-renderer.ts:643
A font is the same kind of channel — ctx.font = "nope" is also ignored instead of thrown. The blast radius is wider than color's — the same string is also used for text measurement, which decides the axis's width and height, so a demotion shakes the layout too.
Returns the string that was actually set — if this were void, the caller wouldn't know what got set, and would compute layout using the requested font even in a frame where a demotion happened.
The verdict gets cached too — since a read-back is only needed when the value changes, the common case where the font stays the same (axis labels within one frame usually share a font) hits the cache and skips the read-back entirely. That said, it's too small a value to show up in frame time (serialization is much cheaper here than for color) — this isn't a speed fix, it's using the same shape as its sibling function (applyColor).
Parameters
context
font
string
font
string
fallback
string
verdicts?
Returns
string