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
{{ message }}
Repository navigation
Variable font in SVG changes from thin weight to tofu (possible regression?) #8367
bugSomething isn't workingregressionSomething that did work before stopped working.svgAnything about the file format for people who like to have fun.textRelated to the text category, which is all about text handling, shaping, etc.
Considering that #185 is still open, I'm not sure if this can be considered as a regression bug. I'm just reporting it anyway.
Typst v0.14.2 renders texts in variable fonts as the lightest weight when exporting to SVG or PDF, and turn them into tofus when exporting to PNG.
Now the SVG case changes to tofus. (PDF & PNG unchanged)
Example
// Exported to SVG#setpage(height: auto, width: auto, margin: 1em)
#settext(5em, fallback: false)
#text(font: "Source Han Sans SC VF")[可变字体]
#text(font: "Source Han Sans SC")[不可变字体]
The weight being thin instead of regular is just because that's the default of the font without configured variations. With my variable fonts PR, it's correct.
The problem with the tofus is specific to TTF fonts with 65536 glyphs. I've opened #8434 to track this more specifically.
I cannot reproduce this having rendered correctly before with the TTF font in SVG export. I just get a fully empty page. The change from nothing to tofus makes sense due to #7679. Are you sure that you can reproduce the thin weight in SVG export on 0.14 with the TTF (as opposed to OTF) variant?
That matches my investigation. The thin weight stuff is fixed with #8425 and the empty -> tofu is tracked by #8434 and not a regression imo. If anything, it's an improvement as you can more clearly see that something went wrong. I'll close this then.
bugSomething isn't workingregressionSomething that did work before stopped working.svgAnything about the file format for people who like to have fun.textRelated to the text category, which is all about text handling, shaping, etc.
Activity
laurmaedje commentedon Jun 4, 2026
The weight being thin instead of regular is just because that's the default of the font without configured variations. With my variable fonts PR, it's correct.
The problem with the tofus is specific to TTF fonts with 65536 glyphs. I've opened #8434 to track this more specifically.
I cannot reproduce this having rendered correctly before with the TTF font in SVG export. I just get a fully empty page. The change from nothing to tofus makes sense due to #7679. Are you sure that you can reproduce the thin weight in SVG export on 0.14 with the TTF (as opposed to OTF) variant?
YDX-2147483647 commentedon Jun 5, 2026
Here are my results for SVG:
laurmaedje commentedon Jun 5, 2026
That matches my investigation. The thin weight stuff is fixed with #8425 and the empty -> tofu is tracked by #8434 and not a regression imo. If anything, it's an improvement as you can more clearly see that something went wrong. I'll close this then.
laurmaedje commentedon Jun 5, 2026
Actually, I misread. The OTF tofu is kind of a regression...
laurmaedje commentedon Jun 5, 2026
But my variable fonts branch still fixes that. :)
Sorry for the back and forth, I got a bit confused...