We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Font.Glyph.get_SVG
1 parent e4be38c commit 2e82375Copy full SHA for 2e82375
1 file changed
Types/Font.Glyph/get_SVG.ps1
@@ -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