Skip to content

Commit 2e82375

Browse files
feat: Font.Glyph.get_SVG ( Fixes #18 )
1 parent e4be38c commit 2e82375

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Types/Font.Glyph/get_SVG.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
$fontFace = $this.ParentNode.'font-face'
2+
$descent = $fontFace.descent -as [double]
3+
$bbox = $fontFace.bbox -split '\s' -as [double[]]
4+
$viewbox = "0 $($bbox[-3] - $descent) $($bbox[-2]) $($bbox[-1])"
5+
@(
6+
"<svg xmlns='http://www.w3.org/2000/svg' viewBox='$viewbox' width='100%' height='100%' transform='scale(1 -1)'>"
7+
"<path fill='currentColor' d='$($this.PathData)' />"
8+
"</svg>"
9+
) -as [xml]

0 commit comments

Comments
 (0)