Skip to content

pantoken / formats/icon-font/src / svgToGlyphPath

Fonksiyon: svgToGlyphPath()

svgToGlyphPath(svg): GlyphPath

Beta

Bir simge SVG'si için doldurulmuş bir glif yolu üret.

Parametreler

svg

string

Satır içi SVG işaretlemesi.

Döndürür

GlyphPath

Doldurulmuş yol d (viewBox koordinatlarında) ve viewBox boyutu.

Örnek

Çizgi tabanlı (Lucide) bir simgenin ve dolgu tabanlı bir simgenin dış hatlarını oluştur

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)