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
I noticed that documents with CJK fonts are compiled with "tofu" text when using typst version 0.12.
I also noticed that compiling to svg works just fine, this seems to be related to pdf.
From what I can gather, the problem lies with the font being a variable font.
When using one of the static Noto Serif CJK variants, the output looks perfectly fine on both 0.11.1 and 0.12.0.
After switching to a variable variant, tofus appear on 0.12.0 and on first glance looks fine on 0.11.0. However, that is just when exporting to PDF.
When exporting to PNG, the output in 0.11.1 is noticeably worse than on 0.12.0:
0.11.1:
0.12.0:
Considering that variable font export never truly functioned correctly for PDFs either (#185), I think the tofus are actually the better choice.
The ideal solution would of course be to support variable fonts, but until that date, you'll have to use a static font.
We could also consider warning the user when trying to use a variable font, or not even selecting it when searching for fonts. Both of these seem tricky and counterproductive, though.
Activity
frozolotl commentedon Oct 22, 2024
From what I can gather, the problem lies with the font being a variable font.
When using one of the static Noto Serif CJK variants, the output looks perfectly fine on both 0.11.1 and 0.12.0.
After switching to a variable variant, tofus appear on 0.12.0 and on first glance looks fine on 0.11.0. However, that is just when exporting to PDF.
When exporting to PNG, the output in 0.11.1 is noticeably worse than on 0.12.0:
Considering that variable font export never truly functioned correctly for PDFs either (#185), I think the tofus are actually the better choice.
The ideal solution would of course be to support variable fonts, but until that date, you'll have to use a static font.
We could also consider warning the user when trying to use a variable font, or not even selecting it when searching for fonts. Both of these seem tricky and counterproductive, though.
leana8959 commentedon Oct 23, 2024
I see, I’ll try using a static font and see if that fixed the problem. Thank you !
leana8959 commentedon Oct 23, 2024
I confirm that Noto CJK's static variant works :)
Would it be possible (if it's a good idea) to detect whether the user is trying to use variable fonts, and show a compiler hint?
laurmaedje commentedon Oct 26, 2024
Opened #5304, closing this.