-
Notifications
You must be signed in to change notification settings - Fork 222
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
.advanceWidth triggers RangeError: Offset is outside the bounds of the DataView #303
Comments
As a slightly more elaborate test, using https://fonts.google.com/noto/specimen/Noto+Sans+New+Tai+Lue: const fs = require("fs");
const fontkit = require("fontkit");
const font = fs.readFileSync("./NotoSansNewTaiLue-Regular.ttf");
const fontObject = fontkit.create(font);
const glyphs = fontObject.glyphsForString(" ");
console.log(glyphs[0]);
console.log(glyphs[0].advanceWidth); yields:
|
Yup, indeed! The exception happens only when you access |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here’s a font called
Noto Sans New Tai Lue
from Google Fonts: H4cKBW-Pl9DZ0Xe_nHUapt7PovLXAhAnY7wqaLy-OJgU3p_pdeXAYUbghFPKzeY.ttf.zipIf you open this font file with Fontkit and try to read the
advanceWidth
of the space glyph, you’ll get aRangeError: Offset is outside the bounds of the DataView
exception.Steps to reproduce the issue:
Download the font
Run
Observe the following error:
Possibly related issue: https://github.com/foliojs/fontkit/issues/179\
The text was updated successfully, but these errors were encountered: