From 6a8b187c95d7e4a70abc669edf12039ec7dbac33 Mon Sep 17 00:00:00 2001 From: "Paul D. Hunt" Date: Thu, 4 Jun 2020 10:02:03 +1000 Subject: [PATCH] Submits WIP. --- Italic/Masters/STAT.fea | 38 ++++++++++++++++++++++++++++ Roman/Masters/STAT.fea | 38 ++++++++++++++++++++++++++++ Roman/Masters/nameIDs.fea | 2 ++ buildVFs.sh | 52 +++++++++++++++++++-------------------- familyOS2.fea | 6 +++-- familynameIDs.fea | 3 ++- familynameIDsVar.fea | 2 ++ featuresVar.fea | 1 + 8 files changed, 113 insertions(+), 29 deletions(-) create mode 100644 Italic/Masters/STAT.fea create mode 100644 Roman/Masters/STAT.fea mode change 100755 => 100644 buildVFs.sh diff --git a/Italic/Masters/STAT.fea b/Italic/Masters/STAT.fea new file mode 100644 index 0000000000..0aaebb66f2 --- /dev/null +++ b/Italic/Masters/STAT.fea @@ -0,0 +1,38 @@ +table STAT { + + ElidedFallbackName { name "Italic"; }; + + DesignAxis wght 0 { name "Weight"; }; + + AxisValue { + location wght 200 200 - 250; + name "ExtraLight Italic"; + }; + + AxisValue { + location wght 300 250 - 350; + name "Light Italic"; + }; + + AxisValue { + location wght 400 350 - 450; + name "Italic"; + flag ElidableAxisValueName; + }; + + AxisValue { + location wght 600 550 - 650; + name "Semibold Italic"; + }; + + AxisValue { + location wght 700 650 - 750; + name "Bold Italic"; + }; + + AxisValue { + location wght 900 800 - 900; + name "Black Italic"; + }; + +} STAT; diff --git a/Roman/Masters/STAT.fea b/Roman/Masters/STAT.fea new file mode 100644 index 0000000000..129dd1ec90 --- /dev/null +++ b/Roman/Masters/STAT.fea @@ -0,0 +1,38 @@ +table STAT { + + ElidedFallbackName { name "Regular"; }; + + DesignAxis wght 0 { name "Weight"; }; + + AxisValue { + location wght 200 200 - 250; + name "ExtraLight"; + }; + + AxisValue { + location wght 300 250 - 350; + name "Light"; + }; + + AxisValue { + location wght 400 350 - 450; + name "Regular"; + flag ElidableAxisValueName; + }; + + AxisValue { + location wght 600 550 - 650; + name "Semibold"; + }; + + AxisValue { + location wght 700 650 - 750; + name "Bold"; + }; + + AxisValue { + location wght 900 800 - 900; + name "Black"; + }; + +} STAT; diff --git a/Roman/Masters/nameIDs.fea b/Roman/Masters/nameIDs.fea index f9b1cd302b..208aae8b39 100644 --- a/Roman/Masters/nameIDs.fea +++ b/Roman/Masters/nameIDs.fea @@ -1 +1,3 @@ +# inlcuded by /SourceSans3/featuresVar.fea + nameid 25 "SourceSansRoman"; diff --git a/buildVFs.sh b/buildVFs.sh old mode 100755 new mode 100644 index 44a7220e3c..c81c8e3895 --- a/buildVFs.sh +++ b/buildVFs.sh @@ -1,7 +1,5 @@ #!/usr/bin/env sh -set -e - ro_name=SourceSansVariable-Roman it_name=SourceSansVariable-Italic @@ -9,54 +7,56 @@ it_name=SourceSansVariable-Italic DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" # clean existing build artifacts -var_dir="$DIR"/target/VAR -rm -rf "$var_dir" -mkdir -p "$var_dir" +var_dir=$DIR/target/VAR +rm -rf $var_dir +mkdir -p $var_dir function build_var_font { # $1 is Master directory # $2 is font name echo $2 - - otf_file="$1"/$2.otf - ttf_file="$1"/$2.ttf - dsp_file="$1"/$2.designspace - # build variable OTF - buildmasterotfs -d "$dsp_file" - buildcff2vf --omit-mac-names -d "$dsp_file" + # --mkot gs is for using the makeotf option -gs, which omits glyphs not in the GOADB + buildmasterotfs --mkot gs -d $1/$2.designspace + buildcff2vf -d $1/$2.designspace # extract and subroutinize the CFF2 table echo 'Subroutinizing' $2.otf - tx -cff2 +S +b -std "$otf_file" "$1"/.tb_cff2 2> /dev/null + tx -cff2 +S +b -std $1/$2.otf $1/.tb_cff2 2> /dev/null # replace CFF2 table with subroutinized version - sfntedit -a CFF2="$1"/.tb_cff2 "$otf_file" + sfntedit -a CFF2=$1/.tb_cff2 $1/$2.otf + + # comment out STAT feature file which cannot be digested by fontmake + sed -i '' 's/^/#/' $1/../../STAT.fea # build variable TTF - fontmake -m "$dsp_file" -o variable --production-names --output-path "$ttf_file" --feature-writer None + fontmake -m $1/$2.designspace -o variable --production-names --output-path $1/$2.ttf - # use DSIG, name, OS/2, hhea, post, STAT, and fvar tables from OTFs - sfntedit -x DSIG="$1"/.tb_DSIG,name="$1"/.tb_name,OS/2="$1"/.tb_os2,hhea="$1"/.tb_hhea,post="$1"/.tb_post,STAT="$1"/.tb_STAT,fvar="$1"/.tb_fvar "$otf_file" - sfntedit -a DSIG="$1"/.tb_DSIG,name="$1"/.tb_name,OS/2="$1"/.tb_os2,hhea="$1"/.tb_hhea,post="$1"/.tb_post,STAT="$1"/.tb_STAT,fvar="$1"/.tb_fvar "$ttf_file" + # use DSIG, name, OS/2, hhea, post, and STAT tables from OTFs + sfntedit -x DSIG=$1/.tb_DSIG,name=$1/.tb_name,OS/2=$1/.tb_os2,hhea=$1/.tb_hhea,post=$1/.tb_post,STAT=$1/.tb_STAT $1/$2.otf + sfntedit -a DSIG=$1/.tb_DSIG,name=$1/.tb_name,OS/2=$1/.tb_os2,hhea=$1/.tb_hhea,post=$1/.tb_post,STAT=$1/.tb_STAT $1/$2.ttf # use cmap, GDEF, GPOS, and GSUB tables from TTFs - sfntedit -x cmap="$1"/.tb_cmap,GDEF="$1"/.tb_GDEF,GPOS="$1"/.tb_GPOS,GSUB="$1"/.tb_GSUB "$ttf_file" - sfntedit -a cmap="$1"/.tb_cmap,GDEF="$1"/.tb_GDEF,GPOS="$1"/.tb_GPOS,GSUB="$1"/.tb_GSUB "$otf_file" + sfntedit -x cmap=$1/.tb_cmap,GDEF=$1/.tb_GDEF,GPOS=$1/.tb_GPOS,GSUB=$1/.tb_GSUB $1/$2.ttf + sfntedit -a cmap=$1/.tb_cmap,GDEF=$1/.tb_GDEF,GPOS=$1/.tb_GPOS,GSUB=$1/.tb_GSUB $1/$2.otf # move font files to target directory - mv "$otf_file" "$var_dir" - mv "$ttf_file" "$var_dir" + mv $1/$2.otf $var_dir + mv $1/$2.ttf $var_dir # delete build artifacts - rm "$1"/.tb_* - rm "$1"/master_*/*.*tf + rm $1/.tb_* + rm $1/master_*/*.*tf + + # undo changes to STAT feature file + sed -i '' 's/#//' $1/../../STAT.fea echo "Done with $2" echo "" echo "" } -build_var_font "$DIR"/Roman/Masters $ro_name -build_var_font "$DIR"/Italic/Masters $it_name +build_var_font $DIR/Roman/Masters $ro_name +build_var_font $DIR/Italic/Masters $it_name diff --git a/familyOS2.fea b/familyOS2.fea index c438a55142..ccd380fa95 100644 --- a/familyOS2.fea +++ b/familyOS2.fea @@ -1,4 +1,4 @@ -# inlcuded by SourceSans3/features.fea +# inlcuded by /SourceSans3/features.fea # NOTE: For cross-platform consistency, OS/2.TypoAscender and |OS/2.TypoDescender| must add up to the font's UPM value TypoAscender 1024; # Must be the same on all fonts for cross-platform consistency @@ -21,6 +21,8 @@ UnicodeRange 0 # Basic Latin 7 # Greek 9 # Cyrillic 29 # Latin Extended Additional + 31 # General Punctuation 32 # Superscripts and Subscripts 30 # Greek Extended - 33; # Currency Symbols + 33 # Currency Symbols + 45; # Geometric Shapes diff --git a/familynameIDs.fea b/familynameIDs.fea index 9fdd1658bc..222e069be1 100644 --- a/familynameIDs.fea +++ b/familynameIDs.fea @@ -1,4 +1,5 @@ -# inlcuded by SourceSans3/features.fea +# inlcuded by /SourceSans3/features.fea +# inlcuded by /SourceSans3/featuresVar.fea nameid 0 "\00a9 2010 - 2020 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name \2018Source\2020."; nameid 7 "Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries."; diff --git a/familynameIDsVar.fea b/familynameIDsVar.fea index 2c7b352859..45c90e0d2d 100644 --- a/familynameIDsVar.fea +++ b/familynameIDsVar.fea @@ -1,2 +1,4 @@ +# inlcuded by /SourceSans3/featuresVar.fea + nameid 285 "Roman"; nameid 286 "Italic"; diff --git a/featuresVar.fea b/featuresVar.fea index 2cf7f22162..93b1ad524a 100644 --- a/featuresVar.fea +++ b/featuresVar.fea @@ -1,4 +1,5 @@ include (../../../familyTables.fea); +include (../STAT.fea); table name { include (../nameIDs.fea);