Created
April 26, 2023 09:39
-
-
Save longnguyen2004/eb5f71bbde259c759cfed8a2f9f3fb0b to your computer and use it in GitHub Desktop.
Revisions
-
longnguyen2004 created this gist
Apr 26, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ $Weights = @{ "ExtraLight" = 200; "Light" = 300; "SemiLight" = 350; "Regular" = 400; "SemiBold" = 600; "Bold" = 700; } $Font = "CascadiaCode"; New-Item -ItemType Directory "generated" -Force foreach ($Weight in $Weights.GetEnumerator()) { $Name, $Value = $Weight.Name, $Weight.Value; Write-Output "Generating $Name variation"; fonttools varLib.mutator -o "output.ttf" "$Font.ttf" "wght=$Value"; $ttx = fonttools ttx -o - -f ./output.ttf; $ttx -replace "Regular",$Name | Out-File "output.ttx"; fonttools ttx -f -o "generated/$Font-$Name.ttf" ./output.ttx; Remove-Item .\output*; }