drei
drei copied to clipboard
3D Text - RangeError: attempting to construct out-of-bounds Uint8Array on ArrayBuffer
Hi, I noticed when I'm attempting to add a font json file made through facetype that I run into an array range error. Opening up the debugger I receive the error
RangeError: attempting to construct out-of-bounds Uint8Array on ArrayBuffer
The error occurs in the following block of code when attempting to load a font file inside troikaDefine().
return function parse(buffer) {
// Look to see if we have a WOFF file and convert it if so:
const peek = new Uint8Array(buffer, 0, 4);
const tag = Typr._bin.readASCII(peek, 0, 4);
if (tag === 'wOFF') {
buffer = woff2otf(buffer);
} else if (tag === 'wOF2') {
throw new Error('woff2 fonts not supported')
}
return wrapFontObj(Typr.parse(buffer)[0])
}

Would anyone have happened to run into this error or know why? I will keep on investigating in the mean time. Thank you!
Im not sure what this issue is refering to.
- Are you using the
Text3dcomponent? If so, then that does not use Troika, it uses ThreeJS'sTextGeometry - Are you using the
Textcomponent? if so, then it does not use the JSON fonts, it uses.ttf,.otfor.woffformats.