Skip to content

Commit

Permalink
Updates batch font script and fixes issues with postprocessing Hack (…
Browse files Browse the repository at this point in the history
…completes fixes #70)
  • Loading branch information
ryanoasis committed Dec 15, 2016
1 parent 62a23e3 commit 62fbb28
Show file tree
Hide file tree
Showing 20 changed files with 26 additions and 14 deletions.
21 changes: 13 additions & 8 deletions bin/scripts/Hack/autohint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,24 @@ command -v ttfautohint >/dev/null 2>&1 || {
# ttfautohint - Input and output file names must not be identical
cp "$fontfile" "${fontfile}.tmp"

if [[ "$fontfile" == *"Hack-Regular"* ]]
if [[ "$fontfile" == *" Regular"* ]]
then
echo "[Nerd Fonts] Hinting Hack Regular"
echo "[Nerd Fonts] Hinting Knack (Hack) Regular"
ttfautohint -l 4 -r 80 -G 350 -x 0 -H 181 -D latn -f latn -w G -W -t -X "" -I -m "bin/scripts/Hack/Hack-Regular-TA.txt" "${fontfile}.tmp" "$fontfile"
elif [[ "$fontfile" == *"Hack-Bold"* ]]
echo "[Nerd Fonts] Hinting Hack Bold"
elif [[ "$fontfile" == *" Bold"* ]]
then
echo "[Nerd Fonts] Hinting Knack (Hack) Bold"
ttfautohint -l 4 -r 80 -G 350 -x 0 -H 260 -D latn -f latn -w G -W -t -X "" -I -m "bin/scripts/Hack/Hack-Bold-TA.txt" "${fontfile}.tmp" "$fontfile"
elif [[ "$fontfile" == *"Hack-Italic"* ]]
echo "[Nerd Fonts] Hinting Hack Italic"
elif [[ "$fontfile" == *" Italic"* ]]
then
echo "[Nerd Fonts] Hinting Knack (Hack) Italic"
ttfautohint -l 4 -r 80 -G 350 -x 0 -H 145 -D latn -f latn -w G -W -t -X "" -I -m "bin/scripts/Hack/Hack-Bold-TA.txt" "${fontfile}.tmp" "$fontfile"
elif [[ "$fontfile" == *"Hack-BoldItalic"* ]]
echo "[Nerd Fonts] Hinting Hack Bold Italic"
elif [[ "$fontfile" == *" BoldItalic"* ]]
then
echo "[Nerd Fonts] Hinting Knack (Hack) Bold Italic"
ttfautohint -l 4 -r 80 -G 350 -x 0 -H 265 -D latn -f latn -w G -W -t -X "" -I -m "bin/scripts/Hack/Hack-Bold-TA.txt" "${fontfile}.tmp" "$fontfile"
else
echo "[Nerd Fonts] Could not find any Knack (Hack) fonts to hint..."
fi

# clean-up
Expand Down
2 changes: 1 addition & 1 deletion bin/scripts/Hack/postprocess.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
fontfile=$1
dir=$(dirname "$0")

#echo "dir $dir"
echo "dir $dir"

"${dir}/autohint.sh" "$fontfile"
"${dir}/../fpfix.py" "$fontfile"
Expand Down
15 changes: 11 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,13 @@ function patch_font {
source "$config_parent_dir/config.cfg"
fi

if [ "$post_process" ]
then
post_process="--postprocess=$post_process"
else
post_process=""
fi

if [ "$config_has_powerline" ]
then
powerline=""
Expand All @@ -87,10 +94,10 @@ function patch_font {
exit 1
}

fontforge -quiet -script ./font-patcher "$f" -q $powerline --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null
fontforge -quiet -script ./font-patcher "$f" -q -s $powerline --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null
fontforge -quiet -script ./font-patcher "$f" -q -w $powerline --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null
fontforge -quiet -script ./font-patcher "$f" -q -s -w $powerline --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/" 2>/dev/null
fontforge -quiet -script ./font-patcher "$f" -q -s $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 -w $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ The following Sankey flow diagram shows the current glyph sets included:
| [Hermut Nerd Font][p-hermit] | | NO | 1000 | ![w2] ![m2] ![l2] |
| [Inconsolata Nerd Font][p-inconsolata] | | NO | 1000 | ![w2] ![m2] ![l2] |
| [Iosevka Nerd Font][p-iosevka] | [Iosevka][f-iosevka] | YES | 1000 | [#83][s-iosevka] |
| [Knack Nerd Font][p-hack] | [Hack][f-hack] | YES | 2048 | [#70][s-hack] |
| [Knack Nerd Font][p-hack] | [Hack][f-hack] | YES | 2048 | ![w2] ![m2] ![l2] |
| [Lekton Nerd Font][p-lekton] | | NO | 1000 | ![w2] ![m2] ![l2] |
| [Literation Mono Nerd Font][p-liberation] | [Liberation][f-liberation] | YES | 2048 | ![w2] ![m2] ![l2] |
| [Meslo Nerd Font][p-meslo] | | NO | 2048 | ![w2] ![m2] ![l2] |
Expand Down

0 comments on commit 62fbb28

Please sign in to comment.