silnrsi / smith

font development, testing and release
Other
14 stars 5 forks source link

path confusion in `opentype()` function #45

Closed bobh0303 closed 6 years ago

bobh0303 commented 6 years ago

When I changed

        opentype = fea(FAMILY + style + '.fea', 
            master = 'source/opentype/master.feax',
            ...

to

        opentype = fea('generated/' + FAMILY + style + '.fea', 
            master = 'source/opentype/master.feax',
      ...

my build broke with this error:

fontTools.feaLib.error.FeatureLibError: [Errno 2] No such file or directory: '../../source/opentype/master.feax'
smith: Leaving directory `/smith/font-harmattan/results'
Build failed
 -> task failed (exit status 1):
        {task 140564375462480: generated/Harmattan-Regular.fea classes.xml,master.feax,Harmattan-Regular.xml -> Harmattan-Regular.fea}
' /usr/bin/psfmakefea -o generated/Harmattan-Regular.fea --omitaps "_above,_below,_center,_ring,_through,above,below,center,ring,through,U,L" -c ../source/classes.xml -i ../../source/opentype/master.feax  generated/Harmattan-Regular.xml '     

using smith build -v -j1 and comparing the commands used in each case, the failing case has an extra ../ in front of the path to the .feax. (edited)

I don't get similar failures for

        graphite=gdl('generated/' + FAMILY + style + '.gdl',
            master = 'source/graphite/master.gdl',

so I'm wondering if this is a smith bug?

bobh0303 commented 6 years ago

Example project: silnrsi/font-harmattan@3224f06e3d2341cc8cff558097bede26519b787b

Edit the fea(...) function to add generated + and the build fails.

mhosken commented 6 years ago

psfmakefea is different from make_fea in that the former has to read the file directly while the latter inserts a path. So psfmakefea needs a path to the master from build directory and not the generated file's directory.

bobh0303 commented 6 years ago

Huh? I didn't change the path to the master feax file. All I did was ask smith to place the built fea into a generated/ subfolder. Are you saying this is not allowed?

devosb commented 6 years ago

If the built fea file cannot go in a subfolder, such as generated/, then the template that smith start produces should not have

opentype=fea('source/' + 'opentype/' + APPNAME + '.fea',

it should have

opentype=fea(APPNAME + '.fea',

I would vote for the former, that is, allow the built fea to be placed in a subfolder.

mhosken commented 6 years ago

Fixed in 4dfbe86ee2db8dd1a85559943b65b0d02d1350b3