Skip to content

Commit

Permalink
Change to use Ygt .yaml hints instead of .xgf.
Browse files Browse the repository at this point in the history
  • Loading branch information
psb1558 committed Jul 5, 2023
1 parent 0385e8f commit d46476f
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions sources/build_font
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ then
exit 1
fi

# If this line fails, maybe you need sed instead of gsed. But in any case you need
# Gnu sed.
# Need Gnu sed. The default (BSD) sed on the Mac won't cut it. There use
# Homebrew to get gsed.

sedcmd="sed"
if command -v gsed &> /dev/null
Expand All @@ -171,6 +171,8 @@ fi
familyname=`$sedcmd -n '1,/<source.*familyname/s/.*familyname="\([^"]*\)"[^\n]*/\1/p' $des`
echo "Building font(s) with family name \"${familyname}\""

# PERFORM EDITS ON DESIGNSPACE AND UFO FILES.

# Every glyph with a "us" anchor also needs a "_us" anchor or fontmake (glyphsLib,
# I think) will mess up the anchors for that glyph. But there is no requirement
# that anchors must be paired this way, and it's easy to imagine the extraneous
Expand Down Expand Up @@ -211,13 +213,11 @@ then
xsltproc -o $des $instanceScript $des
fi

# build the fonts. First things to do for both static types

if [ $outputType != "v" ];
then
# fix-spacing.xsl sets the default spacing via the Spacing axis. Change
# the number in l. 14 of the script (use anything between 0 and 1) to
# change the spacing.
# the number "sp" (use anything between 0 and 1) to change the spacing.
# Now use -p option for this (static fonts only).

xsltproc --param sp $spacing -o $des fix-spacing.xsl $des
if [ $? -ne 0 ]
Expand All @@ -226,8 +226,9 @@ then
exit 1
fi

# Set the slant of the static Italic fonts. Change the number in l. 14
# of the script (using anything between 0 and 15) to change the slant.
# Set the slant of the static Italic fonts. Change the number "sl"
# (using anything between 0 and 15) to change the slant.
# Now use -s option for this (static fonts only).

if [ $fonttype == "italic" ]
then
Expand All @@ -240,6 +241,8 @@ then
fi
fi

# RUN FONTMAKE TO BUILD THE FONTS (s = static TrueType; o = static CFF; v = variable TrueType).

if [ $outputType = "s" ];
then

Expand Down Expand Up @@ -345,7 +348,7 @@ else
elif [ $autohint -ne -1 ]
then
echo "Running Xgridfit"
xgridfit -q -i "${fontname}-VF-withSTAT.ttf" -o "${fontname}.ttf" "xgf/Elstob-${fonttype}-all.xgf"
xgridfit -q -i "${fontname}-VF-withSTAT.ttf" -o "${fontname}.ttf" "xgf/Elstob-${fonttype}-all.yaml"
if [ $? -ne 0 ]
then
echo "Failed to hint with Xgridfit."
Expand Down

0 comments on commit d46476f

Please sign in to comment.