Skip to content

Commit 2101597

Browse files
test: MindYourPsAndQs.font.ps1 ( Fixes #26 )
Adding example of action
1 parent 5e16bac commit 2101597

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Examples/MindYourPsAndQs.font.ps1

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<#
2+
.SYNOPSIS
3+
Mind your 'P's and 'q's
4+
.DESCRIPTION
5+
A simple demo to help you mind your 'P's and 'q's
6+
.NOTES
7+
The phrase "Mind your 'P's and 'q's" originates with typography.
8+
9+
Uppercase P is typically the tallest letter, and lowercase q is typically the lowest letter.
10+
11+
This little example imports the Inconsolata font and gets the 'P' and 'q' characters and saves them as an SVG.
12+
#>
13+
param(
14+
[string]
15+
$FontFamily = 'Inconsolata'
16+
)
17+
18+
$importedFont =
19+
Get-Font |
20+
Where-Object FamilyName -eq $FontFamily |
21+
Select-Object -First 1 |
22+
Import-Font
23+
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"

0 commit comments

Comments
 (0)