Rendering of `👓` good with Katvan but bad with `typst compile`?!

Any ideas what could be going on? I’m running Fedora Asahi Remix 43, maybe something is messed up with my system fonts but Flatpaks are fine because of isolation? Is there something I can do to correct this?

(I see a black rectangle behind the glasses in the exported PDF when compiling with typst compile)

If you didn’t configure an emoji font, which most documents don’t, and you leave text.fallback to its default enabled value, then Typst will find an emoji symbol in some installed font if possible (any suitable font it finds).

So the answer is probably that different fonts are installed for the two different environments. Install an appropriate emoji font, and if possible configure an emoji font for the document. It’s done using the usual text.font setting, with an array of fonts.

It’s sometimes helpful to use set text(fallback: false) at least for troubleshooting, because then it’s clear which symbols are not supported by the fonts you have explicitly set in the document.

2 Likes

Thanks for the tip, I believe I’m halfway there!

Only issue is I have no idea which font supports that specific character. I would need to find a way to find a working font starting from the character…

[UPDATE 2]

I was able to get the ‘eyeglasses’ emoji character (:eyeglasses:) to render properly only with the Adobe repo, but it is archived at the moment and some fonts are missing: instead, I found the (usually) best way here: Make embedded SVG look like it's emoji character - #2 by HoneyPop (Noto-COLRv1.ttf file from GitHub - googlefonts/noto-emoji: Noto Emoji fonts · GitHub)

Then again, emoji support in Typst still appears to be patchy so once you’ve found the font that works well with a certain character, if possible it’s a good idea to tell Typst which font it should use for that piece of text.

[UPDATE]

If you want SVG try this (https://github.com/adobe-fonts/noto-emoji-svg/raw/main/fonts/NotoColorEmoji-SVG.otf+typst compile --ignore-system-fonts --font-path /home/yalihupokn/Downloads/ t.typ)

[ORIGINAL]

This did it in the end! (typst compile --font-path /var/lib/flatpak/runtime t.typ)