Updates batch font script and fixes issues with postprocessing Hack (completes fixes #70)

This commit is contained in:
Ryan L McIntyre 2016-12-14 21:50:36 -05:00
parent 62a23e3651
commit 62fbb28cc3
20 changed files with 26 additions and 14 deletions

View file

@ -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

View file

@ -4,7 +4,7 @@
fontfile=$1
dir=$(dirname "$0")
#echo "dir $dir"
echo "dir $dir"
"${dir}/autohint.sh" "$fontfile"
"${dir}/../fpfix.py" "$fontfile"

View file

@ -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=""
@ -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

View file

@ -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] |