Skip to content

Commit

Permalink
Do not depend on exact font naming
Browse files Browse the repository at this point in the history
[why]
font-patcher renames known fonts (and just adds some naming to unknown
fonts). Which source fonts it knows or not can change anytime.

We fixed the font-patcher version, but maybe want to update some time in
the future, so it would be good to not depend on the exact file name of
the output font.

[how]
- Put prepared fonts into additional directory.
- Use full name globbing, only depend on first letter (i.e. 'C')
- Remove intermediate font after renaming to Delugia*.ttf
- Repeat for all generated fonts

Signed-off-by: Fini Jastrow <[email protected]>
  • Loading branch information
Finii committed Feb 15, 2021
1 parent 3f0db8b commit 0a46f47
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/generate-fonts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,44 +33,50 @@ jobs:
run: fontforge -lang=ff -script extract-extra-glyphs
- name: Prepare Cascadia Code font file
run: |
fontforge prepare-font --input ttf/CascadiaCodePL.ttf --output CascadiaCodePL.ttf
fontforge prepare-font --input ttf/CascadiaMonoPL.ttf --output CascadiaMonoPL.ttf
mkdir prepared
fontforge prepare-font --input ttf/CascadiaCodePL.ttf --output prepared/CascadiaCodePL.ttf
fontforge prepare-font --input ttf/CascadiaMonoPL.ttf --output prepared/CascadiaMonoPL.ttf
- name: Build Powerline
run: |
fontforge -script font-patcher --careful --powerline --custom SomeExtraSymbols.otf \
--no-progressbars --mono CascadiaCodePL.ttf | tee process.log
git describe --always --tags | xargs fontforge rename-font --input Cas*\ Nerd\ Font\ Mono.ttf \
--output "Delugia Nerd Font.ttf" \
--no-progressbars --mono prepared/CascadiaCodePL.ttf | tee process.log
git describe --always --tags | xargs fontforge rename-font --input C*.ttf \
--output "Delugia Nerd Font.ttf" \
--name "Delugia Nerd Font" \
--version
rm C*.ttf
fontforge -script font-patcher --careful --powerline --custom SomeExtraSymbols.otf \
--no-progressbars --mono CascadiaMonoPL.ttf | tee process_mono.log
git describe --always --tags | xargs fontforge rename-font --input "Cascadia Mono PL Nerd Font Mono.ttf" \
--no-progressbars --mono prepared/CascadiaMonoPL.ttf | tee process_mono.log
git describe --always --tags | xargs fontforge rename-font --input C*.ttf \
--output "Delugia Mono Nerd Font.ttf" \
--name "Delugia Mono Nerd Font" \
--version
rm C*.ttf
- name: Build Complete
run: |
fontforge -script font-patcher --careful -c --custom SomeExtraSymbols.otf \
--no-progressbars --mono CascadiaCodePL.ttf | tee process_full.log
git describe --always --tags | xargs fontforge rename-font --input Cas*\ Nerd\ Font\ Complete\ Mono.ttf \
--no-progressbars --mono prepared/CascadiaCodePL.ttf | tee process_full.log
git describe --always --tags | xargs fontforge rename-font --input C*.ttf \
--output "Delugia Nerd Font Complete.ttf" \
--name "Delugia Nerd Font" \
--version
rm C*.ttf
fontforge -script font-patcher --careful -c --custom SomeExtraSymbols.otf \
--no-progressbars --mono CascadiaMonoPL.ttf | tee process_mono_full.log
git describe --always --tags | xargs fontforge rename-font --input "Cascadia Mono PL Nerd Font Complete Mono.ttf" \
--no-progressbars --mono prepared/CascadiaMonoPL.ttf | tee process_mono_full.log
git describe --always --tags | xargs fontforge rename-font --input C*.ttf \
--output "Delugia Mono Nerd Font Complete.ttf" \
--name "Delugia Mono Nerd Font" \
--version
rm C*.ttf
- name: Build Book Complete
run: |
fontforge -script font-patcher --careful -c --custom SomeExtraSymbols.otf \
--no-progressbars CascadiaCodePL.ttf | tee process_book.log
git describe --always --tags | xargs fontforge rename-font --input Cas*\ Nerd\ Font\ Complete.ttf \
--no-progressbars prepared/CascadiaCodePL.ttf | tee process_book.log
git describe --always --tags | xargs fontforge rename-font --input C*.ttf \
--output "Delugia Nerd Font Book.ttf" \
--name "Delugia Nerd Font Book" \
--version
rm C*.ttf
- name: Check for preexisting glyphs
run: |
grep 'Found existing' process*.log
Expand Down

0 comments on commit 0a46f47

Please sign in to comment.