|
1 |
| -#!/bin/env sh |
| 1 | +#!/usr/bin/env sh |
| 2 | + |
| 3 | +folder=RomanMasters |
| 4 | +font=AdobeVFPrototype |
| 5 | + |
| 6 | +# build the OTF version -- this requires an experimental build of the AFDKO which |
| 7 | +# is available at http://www.adobe.com/devnet/opentype/afdko/AFDKO-Variable-Font-Support.html |
| 8 | +buildMasterOTFs $folder/$font.designspace |
| 9 | +buildCFF2VF $folder/$font.designspace |
| 10 | + |
| 11 | +# extract and subroutinize the CFF2 table |
| 12 | +echo 'Subroutinizing' $folder/$font.otf |
| 13 | +tx -cff2 +S +b -std $folder/$font.otf $folder/.tb_cff2 2> /dev/null |
| 14 | + |
| 15 | +# replace CFF2 table with subroutinized version |
| 16 | +sfntedit -a CFF2=$folder/.tb_cff2 $folder/$font.otf 1> /dev/null |
2 | 17 |
|
3 | 18 | # build the TTF version -- this requires a customized version of fontmake which
|
4 | 19 | # is available at https://github.com/adobe-type-tools/fontmake
|
5 |
| -fontmake -m RomanMasters/AdobeVFPrototype.designspace -o variable --production-names |
6 |
| -mv RomanMasters/AdobeVFPrototype-Variable.ttf AdobeVFPrototype.ttf |
| 20 | +fontmake -m $folder/$font.designspace -o variable --production-names |
7 | 21 |
|
8 | 22 | # patch GSUB table, to add <FeatureVariations>
|
9 | 23 | # this enables the transitional glyphs dollar and cent
|
10 |
| -ttx -o AdobeVFPrototype.ttf -m AdobeVFPrototype.ttf GSUB_patch.ttx |
| 24 | +ttx -o $folder/$font.ttf -m $folder/$font.ttf GSUB_patch.ttx |
11 | 25 |
|
12 |
| -# build the OTF version -- this requires an experimental build of the AFDKO which |
13 |
| -# is available at http://www.adobe.com/devnet/opentype/afdko/AFDKO-Variable-Font-Support.html |
14 |
| -buildMasterOTFs RomanMasters/AdobeVFPrototype.designspace |
15 |
| -buildCFF2VF RomanMasters/AdobeVFPrototype.designspace AdobeVFPrototype.otf |
16 |
| -rm RomanMasters/master_*/current.fpr |
| 26 | +# use DSIG, name, OS/2, hhea, post, and STAT tables from OTF |
| 27 | +sfntedit -x DSIG=$folder/.tb_DSIG,name=$folder/.tb_name,OS/2=$folder/.tb_os2,hhea=$folder/.tb_hhea,post=$folder/.tb_post,STAT=$folder/.tb_STAT $folder/$font.otf 1> /dev/null |
| 28 | +sfntedit -a DSIG=$folder/.tb_DSIG,name=$folder/.tb_name,OS/2=$folder/.tb_os2,hhea=$folder/.tb_hhea,post=$folder/.tb_post,STAT=$folder/.tb_STAT $folder/$font.ttf 1> /dev/null |
17 | 29 |
|
18 |
| -# replace the name, GPOS and GSUB tables in the OTF font by the ones from the TTF |
19 |
| -sfntedit -x name=.tb_name,GPOS=.tb_GPOS,GSUB=.tb_GSUB AdobeVFPrototype.ttf |
20 |
| -sfntedit -a name=.tb_name,GPOS=.tb_GPOS,GSUB=.tb_GSUB AdobeVFPrototype.otf |
21 |
| - |
22 |
| -# copy the DSIG table in the OTF font into the TTF |
23 |
| -sfntedit -x DSIG=.tb_DSIG AdobeVFPrototype.otf |
24 |
| -sfntedit -a DSIG=.tb_DSIG AdobeVFPrototype.ttf |
| 30 | +# use cmap, GDEF, GPOS, and GSUB tables from TTF |
| 31 | +sfntedit -x cmap=$folder/.tb_cmap,GDEF=$folder/.tb_GDEF,GPOS=$folder/.tb_GPOS,GSUB=$folder/.tb_GSUB $folder/$font.ttf 1> /dev/null |
| 32 | +sfntedit -a cmap=$folder/.tb_cmap,GDEF=$folder/.tb_GDEF,GPOS=$folder/.tb_GPOS,GSUB=$folder/.tb_GSUB $folder/$font.otf 1> /dev/null |
25 | 33 |
|
26 | 34 | # delete temporary files
|
27 |
| -rm .tb_* |
| 35 | +rm */.tb_* |
| 36 | + |
| 37 | +echo "Done" |
0 commit comments