Skip to content

Commit e889488

Browse files
authored
Merge pull request #9 from rpeb/feat/nerd-font-patch
feat(build): add Nerd Font patched version to CI pipeline
2 parents 064a73a + 2bb41ea commit e889488

1 file changed

Lines changed: 34 additions & 11 deletions

File tree

.github/workflows/build-font.yml

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ jobs:
2727
path: iosevka-src
2828
fetch-depth: 1
2929

30-
# 3. Install system dependencies required by Iosevka
30+
# 3. Install system dependencies required by Iosevka and Nerd Fonts patcher
3131
- name: Install system dependencies
3232
run: |
3333
sudo apt-get update
34-
sudo apt-get install -y ttfautohint python3
34+
sudo apt-get install -y ttfautohint python3 fontforge
3535
3636
# 4. Set up Node.js, which is required by the Iosevka build scripts
3737
- name: Set up Node.js
@@ -59,27 +59,46 @@ jobs:
5959
fi
6060
echo "TTF and WOFF2 build directories verified."
6161
62-
# 8. Create separate ZIP archives for Desktop and Web users
62+
# 8. Download Nerd Fonts patcher
63+
- name: Download Nerd Fonts patcher
64+
run: |
65+
curl -sL "$(gh api repos/ryanoasis/nerd-fonts/releases/latest --jq '.assets[] | select(.name == "FontPatcher.zip") | .browser_download_url')" -o FontPatcher.zip
66+
unzip -q FontPatcher.zip -d nerd-fonts-patcher
67+
env:
68+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
70+
# 9. Patch fonts with Nerd Font glyphs
71+
- name: Patch fonts with Nerd Font glyphs
72+
run: |
73+
mkdir -p patched-fonts
74+
for font in iosevka-src/dist/IoskeleyMono/TTF/*.ttf; do
75+
fontforge -script nerd-fonts-patcher/font-patcher "$font" \
76+
--complete \
77+
--careful \
78+
--outputdir patched-fonts
79+
done
80+
81+
# 10. Create separate ZIP archives for Desktop and Web users
6382
- name: Package font files into separate archives
6483
run: |
65-
# Navigate into the main output directory
6684
cd iosevka-src/dist/IoskeleyMono
6785
68-
# Package the Hinted TTF fonts into the workspace root
6986
zip -r ../../../IoskeleyMono-TTF-Hinted.zip TTF
70-
71-
# Package the Unhinted TTF fonts into the workspace root
7287
zip -r ../../../IoskeleyMono-TTF-Unhinted.zip TTF-Unhinted
73-
74-
# Package all WOFF2 fonts into the workspace root
7588
zip -r ../../../IoskeleyMono-Web.zip WOFF2 WOFF2-Unhinted
7689
77-
# 9. Set the release version number
90+
# 11. Package Nerd Font patched fonts
91+
- name: Package Nerd Font patched fonts
92+
run: |
93+
cd patched-fonts
94+
zip -r ../IoskeleyMono-NerdFont.zip .
95+
96+
# 12. Set release version number
7897
- name: Set Release Version
7998
id: vars
8099
run: echo "tag=$(date +'%Y.%m.%d')-${{ github.run_number }}" >> $GITHUB_OUTPUT
81100

82-
# 10. Create a new GitHub Release and upload all three ZIP files
101+
# 13. Create a new GitHub Release and upload all ZIP files
83102
- name: Create Release and Upload Assets
84103
uses: softprops/action-gh-release@v1
85104
with:
@@ -92,11 +111,15 @@ jobs:
92111
- `IoskeleyMono-TTF-Hinted.zip`: Fonts with hinting. Best for most users on standard-resolution screens.
93112
- `IoskeleyMono-TTF-Unhinted.zip`: Raw fonts without hinting. Preferred by some on high-DPI screens.
94113
114+
**For Terminal Users (Nerd Font):**
115+
- `IoskeleyMono-NerdFont.zip`: Patched with Nerd Font glyphs (Powerline, devicons, etc.). Ideal for Neovim, iTerm, VS Code terminals, and other tools that use iconic fonts.
116+
95117
**For Web Developers:**
96118
- `IoskeleyMono-Web.zip`: Contains all WOFF2 font files for web use (Hinted and Unhinted).
97119
files: |
98120
IoskeleyMono-TTF-Hinted.zip
99121
IoskeleyMono-TTF-Unhinted.zip
122+
IoskeleyMono-NerdFont.zip
100123
IoskeleyMono-Web.zip
101124
env:
102125
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)