Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

otfcc 0.9.6 on macOS x64 yields invalid OTF font after simple roundtrip #68

Open
rsms opened this issue Jan 22, 2020 · 3 comments
Open

Comments

@rsms
Copy link

rsms commented Jan 22, 2020

repro:

# fetch https://github.com/caryll/otfcc/archive/v0.9.6.tar.gz and unarchive
./dep/bin-osx/premake5 ninja
cd build/ninja
ninja otfccdump_release_x64 otfccbuild_release_x64
./bin/release-x64/otfccdump -o Inter-Regular.json Inter-Regular.otf
./bin/release-x64/otfccbuild -o Inter-Regular-otfccbuild.otf Inter-Regular.json

The input file Inter-Regular.otf is from the Inter v3.11 release and is verified to work correctly in a variety of font parsers (also it passes the macOS Font Book validator)

However the output file is not only MUCH larger in size but also does not work on macOS. Font Book validation fails with “System Validation” error:

Screen Shot 2020-01-22 at 08 34 27

Attached here is the input font file, resulting output font file and the JSON dump, to save you some time:
otfs-and-json.zip

Here are TTX dumps with a diff:
ttx-with-diff.zip

I also tried building the latest master from git which yields the exact same results.

Env:

$ uname -rsv
Darwin 18.7.0 Darwin Kernel Version 18.7.0: Sun Dec  1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64
$ ./bin/release-x64/otfccdump -v
This is otfccdump, version 0.9.6.
$ shasum Inter-Regular.otf
389bb3dbdb1bc81c96b000688ed672180b3ee78d  Inter-Regular.otf
@rsms
Copy link
Author

rsms commented Jan 22, 2020

I tried disabling everything I could think of with otfccbuild and still the same issue:

./bin/release-x64/otfccbuild -O0 --keep-unicode-ranges --keep-modified-time \
  --dont-merge-features --dont-merge-lookups --keep-average-char-width \
  -o Inter-Regular-otfccbuild.otf Inter-Regular.json

I ran OTS 7.1.7 on the font files and no combinations of options yields a readable font file. E.g.
ots-validator-checker Inter-Regular-otfccbuild.otffont renderer couldn't open the transcoded font (whereas with the original input file ots-validator-checker Inter-Regular.otffont renderer didn't crash which is OTS’s way of saying that it succeeded. OTS is used in Chrome to validate fonts.)

@be5invis
Copy link
Contributor

Strange. I do not have dev environment for otfcc now since it has been stalled for pretty a while.
Note that if you want to fix rsms/inter#228 by round-tripping with otfcc then it won't. otfcc's bounding box definition is also wrong.

@rsms
Copy link
Author

rsms commented Jan 23, 2020

Thanks for chiming in @be5invis.
I’m working on a project unrelated to Inter where I’d like to use otfcc. I used its code in a C project and kept getting invalid font files as an output; thought it was my code that somehow used the otfcc functions incorrectly, so I tried just compiling with master and latest stable release. Turned out there’s an issue in otfcc :–)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants