Skip to content

pantoken / formats/icon-font/src / svgToGlyphPath

Feidhm: svgToGlyphPath()

svgToGlyphPath(svg): GlyphPath

Béite

Ullmhaigh cosán glífe líonta do SVG deilbhín.

Paraiméadair

svg

string

Marcáil SVG comhtháite.

Tuairisceáin

GlyphPath

An cosán líonta d (i gcomhordáin viewBox) agus méid an viewBox.

Sampla

Leag amach deilbhín bunaithe ar stóc (Lucide) agus deilbhín bunaithe ar líon

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)