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

Function generateVariableFilename

packages/core/src/utils/filename.ts:23–35  ·  view source on GitHub ↗
(
	familyId: string,
	subset: string,
	axisKey: VariableAxisKey,
	style: FontStyle,
	sliceIndex: number,
	format: WebFontFormat,
)

Source from the content-addressed store, hash-verified

21};
22
23export const generateVariableFilename = (
24 familyId: string,
25 subset: string,
26 axisKey: VariableAxisKey,
27 style: FontStyle,
28 sliceIndex: number,
29 format: WebFontFormat,
30): string => {
31 const filenameStyle = formatStyle(style);
32 const sliceSuffix = sliceIndex > 0 ? `-${sliceIndex}` : '';
33
34 return `${familyId}-${subset}-${axisKey.toLowerCase()}-${filenameStyle}${sliceSuffix}.${format}`;
35};

Callers 3

buildFontFunction · 0.90
resolveFontFacesFunction · 0.90
filename.test.tsFile · 0.90

Calls 1

formatStyleFunction · 0.90

Tested by

no test coverage detected