Skip to content

Commit 8554bb7

Browse files
authored
Merge pull request #77 from adam7/feature/update-font-patcher
Update Nerd Font font-patcher
2 parents a16ac8c + 3132a88 commit 8554bb7

7 files changed

Lines changed: 54 additions & 554 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
jobs:
1616
check-for-new-cascadia:
17-
runs-on: ubuntu-20.04
17+
runs-on: ubuntu-22.04
1818
outputs:
1919
tag_name: ${{ env.CASCADIATAG }}
2020
tag_exists: ${{ steps.check_tag.outputs.exists }}
@@ -24,9 +24,7 @@ jobs:
2424
uses: octokit/request-action@v2.x
2525
id: get_latest_release
2626
with:
27-
route: GET /repos/{owner}/{repo}/releases/latest
28-
owner: microsoft
29-
repo: cascadia-code
27+
route: GET /repos/microsoft/cascadia-code/releases/latest
3028
env:
3129
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3230
- name: Get the latest Cascadia tag
@@ -46,14 +44,13 @@ jobs:
4644
build-and-release:
4745
needs: check-for-new-cascadia
4846
if: ${{ github.event_name != 'schedule' || needs.check-for-new-cascadia.outputs.tag_exists != 'true' }}
49-
runs-on: ubuntu-18.04
47+
runs-on: ubuntu-22.04
5048
env:
51-
NERDFONTVERS: v2.1.0
5249
CASCADIATAG: ${{ needs.check-for-new-cascadia.outputs.tag_name }}
5350
CASCADIATAG_ISNOTNEW: ${{ needs.check-for-new-cascadia.outputs.tag_exists }}
5451

5552
steps:
56-
- uses: actions/checkout@v2
53+
- uses: actions/checkout@v3
5754
with:
5855
fetch-depth: 0
5956
- name: Decide on version
@@ -68,29 +65,46 @@ jobs:
6865
fi
6966
echo "OURVERSION=${OURVERSION}" >> $GITHUB_ENV
7067
- name: Download latest version of Cascadia
68+
uses: robinraju/release-downloader@v1.5
69+
with:
70+
repository: "microsoft/cascadia-code"
71+
tag: ${{ needs.check-for-new-cascadia.outputs.tag_name }}
72+
fileName: "*.zip"
73+
- name: Open Cascadia release
7174
run: |
72-
CASCADIAVERS=`curl -L 'https://github.com/microsoft/cascadia-code/releases/latest' | grep CascadiaCode | sed 's!\(.*/microsoft/cascadia-code/releases/download/\([^"]*\).*\|.*span.*\)!\2!'`
73-
echo Downloading ${CASCADIAVERS}
74-
curl -L https://github.com/microsoft/cascadia-code/releases/download/${CASCADIAVERS} -O
75-
unzip CascadiaCode*.zip
76-
- name: Install FontForge
77-
run: |
78-
sudo add-apt-repository ppa:fontforge/fontforge -y -u;
79-
sudo apt-get install fontforge -y;
80-
- name: Download and patch Font Patcher
75+
unzip CascadiaCode*.zip 'ttf/*'
76+
77+
# Ubuntu 20.04 has only fontforge release 2020, but there are some vital bugfixes in the 2022 release
78+
# This can be replaced with the ordinary apt package when Ubuntu updates, probably with 22.10?
79+
- name: Fetch FontForge
8180
run: |
82-
curl -L https://raw.githubusercontent.com/ryanoasis/nerd-fonts/${NERDFONTVERS}/font-patcher --output font-patcher
83-
patch font-patcher 0001*.patch
84-
- name: Download source fonts
81+
sudo apt install software-properties-common python3-fontforge fuse -y -q
82+
curl -L "https://github.com/fontforge/fontforge/releases/download/20220308/FontForge-2022-03-08-582bd41-x86_64.AppImage" \
83+
--output fontforge
84+
chmod u+x fontforge
85+
echo Try appimage
86+
./fontforge --version
87+
export PATH=`pwd`:$PATH
88+
echo "PATH=$PATH" >> $GITHUB_ENV
89+
echo Try appimage with path
90+
fontforge --version
91+
92+
- name: Get Font Patcher
93+
uses: robinraju/release-downloader@v1.5
94+
with:
95+
repository: "ryanoasis/nerd-fonts"
96+
latest: true
97+
fileName: "FontPatcher.zip"
98+
- name: Open Font Patcher release
8599
run: |
86-
chmod +x download-source-fonts.sh
87-
./download-source-fonts.sh
100+
unzip FontPatcher.zip
101+
88102
- name: Install PIP
89-
run: sudo apt install python-pip -y
103+
run: sudo apt install python3-pip -y
90104
- name: Install configparser
91-
run: pip install configparser
105+
run: pip3 install configparser
92106
- name: Extract additional powerline glyphs
93-
run: fontforge -lang=ff -script extract-extra-glyphs
107+
run: fontforge -lang=ff -script "`pwd`/extract-extra-glyphs" "`pwd`" `pwd`/src/**/octicons.ttf
94108
- name: Build Powerline
95109
run: |
96110
./do_generate 01 --powerline --mono CascadiaCodePL-Regular.ttf DelugiaPL.ttf "Delugia PL"
@@ -148,32 +162,32 @@ jobs:
148162
zip delugia-book.zip delugia-book/*
149163
- name: Check for preexisting glyphs
150164
run: |
151-
grep 'Found existing' process*.log
152-
- uses: actions/upload-artifact@master
165+
grep 'Found existing' process*.log | grep -vE ' Powerline(Extra)?Symbols>'
166+
- uses: actions/upload-artifact@v3
153167
with:
154168
name: Delugia Powerline
155169
path: "delugia-powerline"
156-
- uses: actions/upload-artifact@master
170+
- uses: actions/upload-artifact@v3
157171
with:
158172
name: Delugia Mono Powerline
159173
path: "delugia-mono-powerline"
160-
- uses: actions/upload-artifact@master
174+
- uses: actions/upload-artifact@v3
161175
with:
162176
name: Delugia Complete
163177
path: "delugia-complete"
164-
- uses: actions/upload-artifact@master
178+
- uses: actions/upload-artifact@v3
165179
with:
166180
name: Delugia Mono Complete
167181
path: "delugia-mono-complete"
168-
- uses: actions/upload-artifact@master
182+
- uses: actions/upload-artifact@v3
169183
with:
170184
name: Delugia Book
171185
path: "delugia-book"
172186

173187
# Release part
174188
- name: Create tag
175189
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/') && needs.check-for-new-cascadia.outputs.tag_exists != 'true' }}
176-
uses: actions/github-script@v3
190+
uses: actions/github-script@v6
177191
with:
178192
github-token: ${{ github.token }}
179193
script: |

0001-font-patcher-Use-correct-source-font-metrics.patch

Lines changed: 0 additions & 44 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ All of these are available in light, regular, and bold weights. Complemented by
4949

5050
### How is Delugia special?
5151
Compared with other patched versions of Cascadia you will find
52-
* Added symbols ```` (0u2262), ```` (0u2263), ```` (0u276F), and ```` (0u26A1) used with some popular Powerline setups
53-
* All added symbols centered on visual middle of the font (not a bit higher)
54-
* Light and bold weight
55-
* Italic faces
52+
* Added symbol ```` (0u26A1) used with some popular Powerline setups (for not 'Complete')
5653

5754
### How to use
5855
You can download the patched fonts from the [Releases page](https://github.com/adam7/delugia-code/releases) of this

do_generate

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ if [ "$#" -ne 6 ]; then
1919
exit 1
2020
fi
2121

22+
PWD=$( pwd )
23+
2224
rm -f C*.ttf
23-
fontforge -script font-patcher --careful "${3}" --custom SomeExtraSymbols.otf --no-progressbars "ttf/static/${4}" "${2}" | tee "process${1}.log"
25+
fontforge -script "${PWD}/font-patcher" --careful "${3}" --custom SomeExtraSymbols.sfd --no-progressbars "${PWD}/ttf/static/${4}" "${2}" --outputdir "${PWD}" | tee "process${1}.log"
2426

2527
if [ -z "${OURVERSION}" ]; then
2628
# Github CI sets this variable, but this can be useful for manual calls:
2729
OURVERSION=`git describe --always --tags`
2830
fi
29-
fontforge rename-font --orig "ttf/static/${4}" --input C*.ttf --output "${5}" --version "${OURVERSION}" --name "${6}"
31+
fontforge -script "${PWD}/rename-font" --orig "${PWD}/ttf/static/${4}" --input ${PWD}/C*.ttf --output "${PWD}/${5}" --version "${OURVERSION}" --name "${6}"

extract-extra-glyphs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
Open("src/glyphs/Hack-Regular.ttf");
1+
Open($2);
22
SelectAll();
3-
SelectFewer(0u2262,0u2263);
4-
SelectFewer(0u276F);
53
SelectFewer(0u26A1);
64
Clear();
7-
Generate("src/glyphs/SomeExtraSymbols.otf");
5+
Save($1 + "/src/glyphs/SomeExtraSymbols.sfd");

0 commit comments

Comments
 (0)