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

Function parseNamFile

packages/core/src/subsets.ts:25–31  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

23 * Parses the simple .nam file format which contains one codepoint per line.
24 */
25const parseNamFile = (content: string): number[] => {
26 return content
27 .split('\n')
28 .map((line) => line.trim())
29 .filter((line) => line.startsWith('0x'))
30 .map((line) => parseInt(line.split(' ')[0] ?? '0', 16));
31};
32
33/**
34 * Parses the text protobuf format for slicing strategies.

Callers 1

generateSubsetDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected