Open
Description
I'm trying to use fontkit 2.0.0 with a variable font... The first issue was that loading the buffer directly like this:
(async () => {
try {
const response = await fetch('/font.woff2')
const buffer = await response.arrayBuffer()
font = fontkit.create(buffer)
console.log(font, font.namedVariations, font.variationAxes)
generateSvgText()
} catch (err) {
console.error(err);
}
})();
was returning
TypeError: First argument to DataView constructor must be an ArrayBuffer
at new DataView (<anonymous>)
at new DecodeStream (fontkit.js?v=18e2d3af:4122:17)
at Module.$d636bc798e7178db$export$185802fd694ee1f5 (fontkit.js?v=18e2d3af:5242:29)`
Changing this line to font = fontkit.create(new Uint8Array(buffer))
works. But that is not documented anywhere.
The problem I'm facing now is that the font comes with many null
parameters, and variationAxes
and namedVariations
are empty objects.
I've tested with the same fonts that works on this fontkit (1.8.0) demo:
Anyone having problems with Variable Fonts when changing from 1.8.0 to 2.0.0?
Thanks in advance
Metadata
Metadata
Assignees
Labels
No labels
Activity