Skip to content

Documentation / @finchart/core / index / labelFontFamily

Function: labelFontFamily() ​

labelFontFamily(readStyle): string

Defined in: packages/core/src/axis/labels.ts:134

The family resolver everyone drawing text on canvas shares.

ctx.font doesn't know inherit — using the spec's fallback (inherit) as-is makes canvas throw the whole declaration out and draw with the browser's default font instead. These three lines make inherit real on canvas: variable → the container's computed font-family → sans-serif.

Axis labels, markers, and drawing labels all share this — if each held its own literal sans-serif fallback, an app with a house font would end up with axes following the page font while markers and Fibonacci labels stayed stuck on the browser default.

Parameters ​

readStyle ​

StyleReader

Returns ​

string