adobe-type-tools / afdko

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

Subroutinizing doesn't work in windows #1355

Closed dy closed 3 years ago

dy commented 3 years ago

Reopening the issue raised in #1319.

After performing

cp ./font/wavefont.otf ./font/wavefont.min.otf
tx -cff2 +S +b ./font/wavefont.otf > ./font/table.CFF2
sfntedit -a CFF2=./font/table.CFF2 ./font/wavefont.min.otf

from howto example the font is corrupted.

tx -dump -1 wavefont.min.otf 
tx: --- wavefont.min.otf
tx: (cfr) bad INDEX header

The problem persists and is reproducible in windows machine.

kaydeearts commented 3 years ago

Hi @dy , after looking into this bug I realize it may be an issue with handling stdout on Windows.

As an alternative solution, you can try: tx -cff2 +S +b -o ./font/table.CFF2 -f ./font/wavefont.otf

Let me know if that works for you. In the meantime, we'll be looking into a fix for stdout handling on Windows.

dy commented 3 years ago

It worked! Thank you @kaydeearts! Found out that the order of arguments matters:

tx -cff2 +S +b -f ./font/wavefont.otf -o ./font/table.CFF2 

doesn't work. Providing you 2 files: one generated with stdout, the second is with -o: wavefont.zip

Binary difference seems more complex than expected, not just line breaks - different length, different patches.

miguelsousa commented 3 years ago

@dy try without the -o

tx -cff2 +S +b -f ./font/wavefont.otf ./font/table.CFF2 
dy commented 3 years ago

@miguelsousa tried, that failed:

tx: --- ./table.CFF2
tx: (cfr) source stream error