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

Ability to handle **ridiculously** large input #3

Closed
limelightful opened this issue Apr 7, 2017 · 3 comments
Closed

Ability to handle **ridiculously** large input #3

limelightful opened this issue Apr 7, 2017 · 3 comments

Comments

@limelightful
Copy link

While I use these tools to convert some otf to ttf.

otfccdump NotoSerifCJKtc-Regular.otf | otfcc-c2q | otfccbuild -o NotoSerifCJKtc-Regular.ttf

An Error prompts out and says

/usr/lib/node_modules/otfcc-c2q/c2q_cli.js:7
process.stdin.on('data', function (buf) { glyfsource += buf.toString(); });
                                                            ^

RangeError: Invalid string length
    at Socket.<anonymous> (/usr/lib/node_modules/otfcc-c2q/c2q_cli.js:7:61)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at Pipe.onread (net.js:548:20)
otfccbuild : Parse into JSON : [ERROR] Cannot parse JSON file "(null)". Exit.

However, I have no problem converting other fonts like Source Han Sans.
Does node version matter? Node version of my computer is v6.10.0.

@be5invis
Copy link
Contributor

be5invis commented Apr 7, 2017 via email

@be5invis be5invis changed the title Error at converting Source Han Serif Ability to handle **ridiculously** large input Apr 7, 2017
@m13253
Copy link

m13253 commented Apr 25, 2017

For some reason (bug 1, bug 2), Node.js cannot handle input longer than 512 MiB (256 mebi UTF-16 code units).

According to a Stack Overflow post, JSONStream might be useful to load and store this kind of large JSON object.
I don't have time to modify the source code and test right now. Hope someone could do this for us.

@be5invis
Copy link
Contributor

I think it is fixed now. Currently c2q depends on Megaminx backwards and can read arbitrary-sized font as input.

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

3 participants