Skip to content

Commit 25cb7d3

Browse files
feat: Font.Glyph.get_Motion ( Fixes #21 )
1 parent 6b39ec6 commit 25cb7d3

2 files changed

Lines changed: 19 additions & 8 deletions

File tree

Types/Font.Glyph/get_Motion.ps1

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
$PathData = $this.PathData
6+
@(
7+
"<svg xmlns='http://www.w3.org/2000/svg' viewBox='$viewbox' width='100%' height='100%' transform='scale(1 -1)'>"
8+
"<path stroke='currentColor' d='$($PathData)' />"
9+
@"
10+
<circle r="5" fill="currentColor">
11+
<animateMotion
12+
dur="10s"
13+
repeatCount="indefinite"
14+
path="$($PathData)" />
15+
</circle>
16+
"@
17+
"</svg>"
18+
) -as [xml]
19+

Types/Font.Glyph/get_Outline.ps1

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,4 @@ $viewbox = "0 $($bbox[-3] - $descent) $($bbox[-2]) $($bbox[-1])"
55
@("<svg xmlns='http://www.w3.org/2000/svg' viewBox='$viewbox' width='100%' height='100%' transform='scale(1 -1)'>"
66

77
"<path stroke='currentColor' d='$($this.PathData)' />"
8-
@"
9-
<circle r="5" fill="red">
10-
<animateMotion
11-
dur="10s"
12-
repeatCount="indefinite"
13-
path="$($pathData)" />
14-
</circle>
15-
"@
168
"</svg>") -as [xml]

0 commit comments

Comments
 (0)