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.svg.GetGlyph()
1 parent cecc19a commit 9677907Copy full SHA for 9677907
1 file changed
Types/Font.svg/GetGlyph.ps1
@@ -2,8 +2,19 @@ param(
2
[PSObject]$value
3
)
4
5
+filter toGlyph {
6
+ $_.Node.pstypenames.add('Font.glyph')
7
+ $_.Node
8
+}
9
if ($value -is [string] -and $value.Length -le 2) {
- $this.SVG |
- Select-Xml -Namespace @{s='http://www.w3.org/2000/svg'} -XPath "//s:glyph[@unicode='$($value -replace "'", "''")']" |
- Select-Object -ExpandProperty Node
10
+ $escapedValue = $($value -replace "'","''")
11
+ $this.XML |
12
+ Select-Xml -Namespace @{s='http://www.w3.org/2000/svg'} -XPath "//s:glyph[@unicode='$escapedValue'] | //s:glyph[@glyph-name='$escapedValue']" |
13
+ toGlyph
14
15
+
16
+if ($null -eq $value) {
17
18
+ Select-Xml -Namespace @{s='http://www.w3.org/2000/svg'} -XPath "//s:glyph" |
19
20
}
0 commit comments