import codepoints from '../../assets/fonts/shoptet/shp.json'; import type { IconName } from './IconName'; const codepointMap: Record = codepoints; /** * Resolves an {@link IconName} to its icon-font glyph character, using the committed fantasticon * codepoint artifact (`shp.json`, name → decimal codepoint). Use when rendering the glyph directly * as text (e.g. an SVG `` element) instead of via the `.icon` CSS class. */ export function iconGlyphChar(name: IconName): string { const codepoint = codepointMap[name]; return codepoint === undefined ? '' : String.fromCodePoint(codepoint); }