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

fontkit wont load fonts in Node 23 #356

Open
wesbos opened this issue Dec 20, 2024 · 0 comments
Open

fontkit wont load fonts in Node 23 #356

wesbos opened this issue Dec 20, 2024 · 0 comments

Comments

@wesbos
Copy link

wesbos commented Dec 20, 2024

hello - I'm using Node 23 with next/font, and I've tracked down an issue with fonts not loading to this package.

var fontkit = require("fontkit");
var font = fontkit.openSync("Geist-Black.ttf");

Gives this error:

Error: Unknown font format

The error is "RangeError: Offset is outside the bounds of the DataView" and being thrown here:

var header = DFontHeader.decode(stream);

Which looks to be because Node 23 now throws an error when reading a buffer outside bounds:

nodejs/node#54588

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

1 participant