Skip to content

Commit 1c69fca

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: Font.Glyph.get_Motion ( Fixes #21 )
1 parent 25cb7d3 commit 1c69fca

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

Font.types.ps1xml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,40 @@
2323
<Name>Font.Glyph</Name>
2424
<Members>
2525
<ScriptProperty>
26-
<Name>Outline</Name>
26+
<Name>Motion</Name>
2727
<GetScriptBlock>
2828
$fontFace = $this.ParentNode.'font-face'
2929
$descent = $fontFace.descent -as [double]
3030
$bbox = $fontFace.bbox -split '\s' -as [double[]]
3131
$viewbox = "0 $($bbox[-3] - $descent) $($bbox[-2]) $($bbox[-1])"
32-
@("&lt;svg xmlns='http://www.w3.org/2000/svg' viewBox='$viewbox' width='100%' height='100%' transform='scale(1 -1)'&gt;"
33-
34-
"&lt;path stroke='currentColor' d='$($this.PathData)' /&gt;"
32+
$PathData = $this.PathData
33+
@(
34+
"&lt;svg xmlns='http://www.w3.org/2000/svg' viewBox='$viewbox' width='100%' height='100%' transform='scale(1 -1)'&gt;"
35+
"&lt;path stroke='currentColor' d='$($PathData)' /&gt;"
3536
@"
36-
&lt;circle r="5" fill="red"&gt;
37+
&lt;circle r="5" fill="currentColor"&gt;
3738
&lt;animateMotion
3839
dur="10s"
3940
repeatCount="indefinite"
40-
path="$($pathData)" /&gt;
41+
path="$($PathData)" /&gt;
4142
&lt;/circle&gt;
4243
"@
44+
"&lt;/svg&gt;"
45+
) -as [xml]
46+
47+
48+
</GetScriptBlock>
49+
</ScriptProperty>
50+
<ScriptProperty>
51+
<Name>Outline</Name>
52+
<GetScriptBlock>
53+
$fontFace = $this.ParentNode.'font-face'
54+
$descent = $fontFace.descent -as [double]
55+
$bbox = $fontFace.bbox -split '\s' -as [double[]]
56+
$viewbox = "0 $($bbox[-3] - $descent) $($bbox[-2]) $($bbox[-1])"
57+
@("&lt;svg xmlns='http://www.w3.org/2000/svg' viewBox='$viewbox' width='100%' height='100%' transform='scale(1 -1)'&gt;"
58+
59+
"&lt;path stroke='currentColor' d='$($this.PathData)' /&gt;"
4360
"&lt;/svg&gt;") -as [xml]
4461
</GetScriptBlock>
4562
</ScriptProperty>

0 commit comments

Comments
 (0)