Skip to content

Commit 9e33cd5

Browse files
feat: Font.Glyph.Save() ( Fixes #27 )
1 parent 960a669 commit 9e33cd5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Examples/MindYourPsAndQs.font.ps1

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,5 @@ $importedFont =
2121
Select-Object -First 1 |
2222
Import-Font
2323

24-
$importedFont.GetGlyph("P").SVG.Save("$pwd/${FontFamily}_P.svg")
25-
Get-Item "$pwd/${FontFamily}_P.svg"
26-
$importedFont.GetGlyph("q").SVG.Save("$pwd/${FontFamily}_q.svg")
27-
Get-Item "$pwd/${FontFamily}_q.svg"
24+
$importedFont.GetGlyph("P").Save("./${FontFamily}_P.svg")
25+
$importedFont.GetGlyph("q").Save("./${FontFamily}_q.svg")

Types/Font.Glyph/Save.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
param([string]$FilePath)
2+
3+
$unresolvedPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($FilePath)
4+
$createdFile = New-Item -ItemType File -Path $unresolvedPath
5+
$this.SVG.Save($createdFile.FullName)
6+
Get-Item -LiteralPath $createdFile.FullName

0 commit comments

Comments
 (0)