opentypejs / opentype.js

Read and write OpenType fonts using JavaScript.
https://opentype.js.org/
MIT License
4.38k stars 468 forks source link

Since 1.0.0: error getting features #378

Closed Monokai closed 5 years ago

Monokai commented 5 years ago

Updated to 1.0.0, but getting undefined is not an object (evaluating 'defaultLangSys.featureIndexes') error messages when I'm trying to render text using several fonts. It doesn't happen with all fonts, but these messages didn't appear at all in the previous version (0.11), so I think something changed. I read the RELEASES.MD about the new default features, but I'm not actually sure this impacts my code.

This also happens in the font inspector on https://opentype.js.org

Attaching an erroneous font. 2a8a6af373531a35.woff.zip

Jolg42 commented 5 years ago

Hi @Monokai ;-)

I just added a condition to make sure that variable is defined in 1.0.1 (should be deployed in a few minutes), it works for me but I'll let you close this issue after testing it as well.

Here is the fix https://github.com/opentypejs/opentype.js/commit/05194b0374b7717f1e275be63463fad6c46542ba

Monokai commented 5 years ago

Thanks for the quick fix! Solves everything :)