You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! Enjoying your package in multiple projects, but there is 1 blocking issue for me here.
It can be demonstrated with this simple code block in browser environment (similar flow doesnt work in Node.js as well):
async function downloadFont() {
if (variableFontFile) {
const url = URL.createObjectURL(variableFontFile)
const font = await opentype.load(url)
font.download()
URL.revokeObjectURL(url)
}
}
If url points to any variable font (Open Sans .ttf in this case), then the downloaded result will only contain one variation. So variable font file narrows down to just static font file.
Is there a way to fix that, or it is just not supported yet?
const font = await opentype.load(url) would return a opentype.js font object but not a recompiled font file you could use for downloads.
Besides, opentype.js font creation/compiling capabilities are limited.
Afaik, there is only support for CFF(1) so truetypes using glyph command structure (using quadratic béziers) would be converted. Also I'm not sure if variable font compiling is yet supported by version 2.
In other words: you shouldn't expect a simple "pass-through" export – the same applies to pretty much any parsing library because we always have a quite complex parsing process (which may not cover 100% of the input font data) and a complex compiling process as well.
I have the suspicion, you're trying to deploy opentype.js for some subsetting application (removing glyphs or design axes) – if so you may rather use other tools like python based fonttools.
Hello! Enjoying your package in multiple projects, but there is 1 blocking issue for me here.
It can be demonstrated with this simple code block in browser environment (similar flow doesnt work in Node.js as well):
If url points to any variable font (Open Sans .ttf in this case), then the downloaded result will only contain one variation. So variable font file narrows down to just static font file.
Is there a way to fix that, or it is just not supported yet?
Fonts issue.zip
The text was updated successfully, but these errors were encountered: