Skip to content

pantoken / formats/icon-font/src / svgToGlyphPath

Mahi: svgToGlyphPath()

svgToGlyphPath(svg): GlyphPath

Beta

Hangaia he ara tohu kapi mō tētahi tohu SVG.

Ngā Tawhā

svg

string

Hōputu SVG ā-roto.

Whakahokia

GlyphPath

Te ara kapi d (i ngā co-ordinates o te viewBox) me te rahi o te viewBox.

Tauira

Whakaahua he tohu ā-raina (Lucide) me tētahi tohu ā-kapi

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)