MCPcopy Create free account
hub / github.com/fontsource/fontsource / createFontVariation

Function createFontVariation

website/app/components/preview/observables.ts:21–26  ·  view source on GitHub ↗
(axes: Record<string, number | undefined>)

Source from the content-addressed store, hash-verified

19
20// Generate font-variation-settings string from axes object e.g. "wght" 400, "wdth" 100
21const createFontVariation = (axes: Record<string, number | undefined>) =>
22 Object.entries(axes)
23 .flatMap(([key, value]) =>
24 value === undefined ? [] : [`"${key}" ${value}`],
25 )
26 .join(', ');
27
28export { createFontVariation, type FontIDObject, type FontIDState };

Callers 1

FontFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected