fontkit wont load fonts in Node 23
Opened this issue · 2 comments
wesbos commented
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:
Line 49 in fbf3b9e
Which looks to be because Node 23 now throws an error when reading a buffer outside bounds:
BBaoVanC commented
I can reproduce with Node v23.4.0 on Arch Linux. How did you find the source of the error? It's all just minified garbage for me.
BBaoVanC commented
It seems to be fixed on 23.5.0 for some reason.