Open superelchi opened 4 years ago
I am also running into this issue. Some fonts seem to be fine, while others return NaN for all advance widths. Attached is an OTF file that has this issue. BellweatherSans-Regular.zip
For the attached OTF, I investigated with TTX and the width information seems to be correct there (Looking for Latin Capital A to have an Advance Width of 1407):
Also appears correctly in Font Forge:
The Advance Width is not coming through when I try it locally, but here it is not working on https://opentype.js.org/glyph-inspector.html As you can see, Advance Width is having issues... but the maxes are as well, and the glyph is not drawing. In my local environment I do have access to the path information which is what I primarily use... but it seems like there is some bug with some calculation.
Edit Oh snap locally I'm still using v0.11.0 😄 but the Glyph Inspector is using v1.3.3 - the issue appears for both versions... and probably all the versions in between?
Is this project abandoned?
Encountered similar issue here. I checked the code & CFF docs and found the root cause - basically it's the uninitialized _nominalWidthX
that caused this issue. Then I just realized it has been solved by @ZeroUltimax's pull request https://github.com/opentypejs/opentype.js/pull/445
Since the pull request is merged after 1.3.3, the fix is not released yet. Perhaps @Jolg42 can make a release v1.3.4?
After writing a font to disk and reading it back advanceWidth for all Glyphs is set to NaN after calling Glyph.getBoundingBox.
Expected Behavior
Glyph.advanceWidth should return a number.
Current Behavior
Glyph.advanceWidth returns NaN for all Glyphs.
Steps to Reproduce (for bugs)
Your Environment