adobe-type-tools / afdko

Adobe Font Development Kit for OpenType
https://adobe-type-tools.github.io/afdko/
Other
1.06k stars 167 forks source link

[sfntedit] Wrong missing filename shown #1658

Closed tamcy closed 1 year ago

tamcy commented 1 year ago

When I run the following command:

sfntedit -x cmap=.tb_cmap,GDEF=.tb_GDEF,GPOS=.tb_GPOS,GSUB=.tb_GSUB,DSIG=.tb_DSIG,name=.tb_name,OS/2=.tb_OS2,hhea=.tb_hhea,post=.tb_post,STAT=.tb_STAT,fvar=.tb_fvar <file>

sfntedit shows the following warning, and no .tb_DSIG file is produced.

sfntedit [WARNING]: table missing (DSIG)

This is fine, but when I try running the following command to replace the tables:

sfntedit -a cmap=.tb_cmap,GDEF=.tb_GDEF,GPOS=.tb_GPOS,GSUB=.tb_GSUB,DSIG=.tb_DSIG,name=.tb_name,OS/2=.tb_OS2,hhea=.tb_hhea,post=.tb_post,STAT=.tb_STAT,fvar=.tb_fvar <file>

sfntedit shows the following error:

sfntedit [FATAL]: file error <No such file or directory> [.tb_post]

The problem is that it is actually .tb_DSIG, not .tb_post that is missing. When I replace .tb_post with an inexisting filename, the message becomes:

sfntedit [FATAL]: file error <No such file or directory> [.tb_name]

So it looks like sfntedit is incorrectly showing the file that exists, instead of the non-existent one. This increases difficulty in debugging.

frankrolf commented 1 year ago

I also ran into this recently – very confusing.