Skip to content

pantoken / formats/icon-font/src / svgToGlyphPath

Funksjon: svgToGlyphPath()

svgToGlyphPath(svg): GlyphPath

Beta

Generer en fylt glyph-sti for en ikon-SVG.

Parametere

svg

string

Innebygd SVG-markup.

Returnerer

GlyphPath

Den fylte stien d (i viewBox-koordinater) og viewBox-størrelsen.

Eksempel

Skisser et strekbasert (Lucide)-ikon og et fylt ikon

ts
import { svgToGlyphPath } from "@pantoken/icon-font";
import { getIcon } from "@pantoken/icons";

const { d, width, height } = svgToGlyphPath(getIcon("arrow-left")!.svg);
// d: a single filled path; width/height: the viewBox size (e.g. 24, 24)