1
0
Fork 0
mirror of https://github.com/adobe-fonts/source-sans.git synced 2025-01-19 15:22:18 +01:00

Update build scripts

This commit is contained in:
Miguel Sousa 2017-07-11 06:10:04 -07:00
parent 7b789e30d5
commit 9050a7926b
3 changed files with 45 additions and 19 deletions

View file

@ -43,12 +43,8 @@ goto :eof
:: %1 - Roman/Italic
:: %2 - Weight
:build_font
call makeotf -f "%~dp0\%1\%2\font.ufo" -r -o "%TARGET_OTF_PATH%\%FAMILY%-%2.otf"
call makeotf -f "%~dp0\%1\%2\font.ttf" -r -o "%TARGET_TTF_PATH%\%FAMILY%-%2.ttf"
:: remove default options file from the source tree after building
del "%~dp0\%1\%2\current.fpr"
:: "%PYTHON_PATH%" "%~dp0\addSVGtable.py" "%TARGET_OTF_PATH%\%FAMILY%-%2.otf" "%~dp0\svg"
:: "%PYTHON_PATH%" "%~dp0\addSVGtable.py" "%TARGET_TTF_PATH%\%FAMILY%-%2.ttf" "%~dp0\svg"
call makeotf -f "%~dp0\%1\Instances\%2\font.ufo" -r -o "%TARGET_OTF_PATH%\%FAMILY%-%2.otf"
call makeotf -f "%~dp0\%1\Instances\%2\font.ttf" -r -o "%TARGET_TTF_PATH%\%FAMILY%-%2.ttf"
goto :eof
:error_makeotf_not_found

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/env sh
family=SourceSansPro
romanWeights='Black Bold ExtraLight Light Regular Semibold'
@ -10,15 +10,15 @@ mkdir target/ target/OTF/ target/TTF/
for w in $romanWeights
do
makeotf -f Roman/$w/font.ufo -r -o target/OTF/$family-$w.otf
makeotf -f Roman/$w/font.ttf -r -o target/TTF/$family-$w.ttf
rm Roman/$w/current.fpr # remove default options file from the source tree after building
font_path=Roman/Instances/$w/font
makeotf -f $font_path.ufo -r -o target/OTF/$family-$w.otf
makeotf -f $font_path.ttf -r -o target/TTF/$family-$w.ttf -ff $font_path.ufo/features.fea
done
for w in $italicWeights
do
makeotf -f Italic/$w/font.ufo -r -o target/OTF/$family-$w.otf
makeotf -f Italic/$w/font.ttf -r -o target/TTF/$family-$w.ttf
rm Italic/$w/current.fpr # remove default options file from the source tree after building
font_path=Italic/Instances/$w/font
makeotf -f $font_path.ufo -r -o target/OTF/$family-$w.otf
makeotf -f $font_path.ttf -r -o target/TTF/$family-$w.ttf -ff $font_path.ufo/features.fea
done

View file

@ -1,8 +1,38 @@
buildMasterOTFs RomanMasters/SourceSansPro.designspace
buildCFF2VF RomanMasters/SourceSansPro.designspace RomanMasters/SourceSansPro-Variable.otf
#!/bin/env sh
buildMasterOTFs ItalicMasters/SourceSansPro-Italic.designspace
buildCFF2VF ItalicMasters/SourceSansPro-Italic.designspace ItalicMasters/SourceSansPro-VariableItalic.otf
rom=Roman/Masters
itm=Italic/Masters
rm *Masters/master_*/current.fpr
rm *Masters/master_*/master.otf
# build variable OTFs
buildMasterOTFs $rom/SourceSansVariable-Roman.designspace
buildCFF2VF $rom/SourceSansVariable-Roman.designspace
buildMasterOTFs $itm/SourceSansVariable-Italic.designspace
buildCFF2VF $itm/SourceSansVariable-Italic.designspace
# extract and subroutinize the CFF2 table
tx -cff2 +S +b -std $rom/SourceSansVariable-Roman.otf $rom/.tb_cff2
tx -cff2 +S +b -std $itm/SourceSansVariable-Italic.otf $itm/.tb_cff2
# replace CFF2 table with subroutinized version
sfntedit -a CFF2=$rom/.tb_cff2 $rom/SourceSansVariable-Roman.otf
sfntedit -a CFF2=$itm/.tb_cff2 $itm/SourceSansVariable-Italic.otf
# build variable TTFs
fontmake -m $rom/SourceSansVariable-Roman.designspace -o variable --production-names
fontmake -m $itm/SourceSansVariable-Italic.designspace -o variable --production-names
# use DSIG, name, OS/2, and STAT tables from OTFs
sfntedit -x DSIG=$rom/.tb_DSIG,name=$rom/.tb_name,OS/2=$rom/.tb_os2,STAT=$rom/.tb_STAT $rom/SourceSansVariable-Roman.otf
sfntedit -a DSIG=$rom/.tb_DSIG,name=$rom/.tb_name,OS/2=$rom/.tb_os2,STAT=$rom/.tb_STAT $rom/SourceSansVariable-Roman.ttf
sfntedit -x DSIG=$itm/.tb_DSIG,name=$itm/.tb_name,OS/2=$itm/.tb_os2,STAT=$itm/.tb_STAT $itm/SourceSansVariable-Italic.otf
sfntedit -a DSIG=$itm/.tb_DSIG,name=$itm/.tb_name,OS/2=$itm/.tb_os2,STAT=$itm/.tb_STAT $itm/SourceSansVariable-Italic.ttf
# use cmap, GDEF, GPOS, and GSUB tables from TTFs
sfntedit -x cmap=$rom/.tb_cmap,GDEF=$rom/.tb_GDEF,GPOS=$rom/.tb_GPOS,GSUB=$rom/.tb_GSUB $rom/SourceSansVariable-Roman.ttf
sfntedit -a cmap=$rom/.tb_cmap,GDEF=$rom/.tb_GDEF,GPOS=$rom/.tb_GPOS,GSUB=$rom/.tb_GSUB $rom/SourceSansVariable-Roman.otf
sfntedit -x cmap=$itm/.tb_cmap,GDEF=$itm/.tb_GDEF,GPOS=$itm/.tb_GPOS,GSUB=$itm/.tb_GSUB $itm/SourceSansVariable-Italic.ttf
sfntedit -a cmap=$itm/.tb_cmap,GDEF=$itm/.tb_GDEF,GPOS=$itm/.tb_GPOS,GSUB=$itm/.tb_GSUB $itm/SourceSansVariable-Italic.otf
# delete build artifacts
rm */Masters/master_*/master.*tf
rm */Masters/.tb_*