Skip to content

Commit

Permalink
patch-em-all: Allow to specify font specific options
Browse files Browse the repository at this point in the history
[why]
We want to patch Cascadia with `--parser` while all other fonts shall be
patched as before.

[how]
Use the config.cfg file that each source font can have to specify one
arbitrary option to the font-patcher calls.

This is just set in Cascadia's config.cfg, but can be extended to other
fonts gradually.

In this way the stand alone `font-patcher` works as before, unless
someone adds the `--parser` option. Which probably will become the
recommended way to use it over time.

The patch-em-all script on the other hand can be instructed to use or
not to use --parser on a font by font basis via their cfg file.

Signed-off-by: Fini Jastrow <[email protected]>
  • Loading branch information
Finii committed Feb 6, 2022
1 parent a04efcb commit 9e2bc9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bin/scripts/gotta-patch-em-all-font-patcher!.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function patch_font {
config_dir=$( cd "$( dirname "$f" )" && pwd)

# source the font config file if exists:
# fetches for example config_patch_flags
if [ -f "$config_dir/config.cfg" ]
then
# shellcheck source=/dev/null
Expand Down Expand Up @@ -114,10 +115,10 @@ function patch_font {
exit 1
}

fontforge -quiet -script ./font-patcher "$f" -q $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null
fontforge -quiet -script ./font-patcher "$f" -q -s ${font_config} $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null
fontforge -quiet -script ./font-patcher "$f" -q -w $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null
fontforge -quiet -script ./font-patcher "$f" -q -s ${font_config} -w $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null
fontforge -quiet -script ./font-patcher "$f" -q $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" $config_patch_flags 2>/dev/null
fontforge -quiet -script ./font-patcher "$f" -q -s ${font_config} $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" $config_patch_flags 2>/dev/null
fontforge -quiet -script ./font-patcher "$f" -q -w $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" $config_patch_flags 2>/dev/null
fontforge -quiet -script ./font-patcher "$f" -q -s ${font_config} -w $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" $config_patch_flags 2>/dev/null
# wait for this group of background processes to finish to avoid forking too many processes
# that can add up quickly with the number of combinations
#wait
Expand Down
1 change: 1 addition & 0 deletions src/unpatched-fonts/CascadiaCode/config.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
config_rfn="Cascadia Code"
config_rfn_substitue="Caskaydia Cove"
config_patch_flags="--parser"

0 comments on commit 9e2bc9a

Please sign in to comment.