Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'length' of null #32

Closed
defue opened this issue Mar 21, 2016 · 1 comment
Closed

TypeError: Cannot read property 'length' of null #32

defue opened this issue Mar 21, 2016 · 1 comment

Comments

@defue
Copy link
Contributor

defue commented Mar 21, 2016

Code:

var fontkit = require('fontkit');
var font = fontkit.openSync('Confetti Regular.ttf');
var run = font.layout('hello world!');

Output:

/home/defue/node_modules/brotli/build/decode.js:1
orts, require, module, __filename, __dirname) { function e(a){throw a;}var j=v
                                                                    ^
TypeError: Cannot read property 'length' of null
    at GSUBProcessor.OTProcessor.findScript (/home/defue/node_modules/fontkit/src/opentype/OTProcessor.js:29:28)
    at GSUBProcessor.OTProcessor.selectScript (/home/defue/node_modules/fontkit/src/opentype/OTProcessor.js:56:24)
    at GSUBProcessor.OTProcessor (/home/defue/node_modules/fontkit/src/opentype/OTProcessor.js:20:12)
    at new GSUBProcessor (/home/defue/node_modules/fontkit/src/opentype/GSUBProcessor.js:16:50)
    at new OTLayoutEngine (/home/defue/node_modules/fontkit/src/opentype/OTLayoutEngine.js:20:30)
    at new LayoutEngine (/home/defue/node_modules/fontkit/src/layout/LayoutEngine.js:25:129)
    at TTFFont.layout (/home/defue/node_modules/fontkit/src/TTFFont.js:216:30)
    at Object.<anonymous> (/home/defue/Tagul/svn/Frontend/canvasForm/components/fontkit/test.js:3:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

Nodejs v0.10.25
Fontkit v
Confetti Regular.ttf.zip
1.2.1

@devongovett
Copy link
Member

Fixed by the above commit. Was caused by a GSUB table with a null script list.

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

No branches or pull requests

2 participants