How to reference custom fonts

Could someone walk me through how to reference a custom font? Using small words, maybe pictures?

I’ve read the documentation, and it mostly seems to be oriented to using Typst from the command line. However, I use TinyMist in VS Code.

It’s not an installation problem, as the same font works fine with LibreOffice and with LaTeX. I’ve tried putting the .otf in the project file. I tried it in a couple different documents to see if something else I was doing might be interfering. Nothing works. I keep getting the “unknown font family” error (and then it defaults to Libertinus Serif).

BTW, if I enter “Typst fonts” in the terminal it’s listed.

OK, I worked out the original problem by following instructions here fonts in all environment · typst/typst · Discussion #5013 · GitHub.

New problem #1: Not all of my fonts in the referenced folders are recognized, just an apparently random assortment of them.

New problem #2: At least one font that is recognized, and works normally in other apps, has a problem where the roman, bold, and bold italic are all correct, but italic comes out bold italic, too.

Code:
Screenshot From 2025-02-05 18-04-52

Output: image

Sorry, I meant that the roman and bold italic come out normally, but the bold becomes roman and the italic becomes bold italic.

Again, the font works fine in other apps, and a few other fonts I randomly sampled in Typst still work normally.

Is there something different about the way Typst recognizes members of a font family?

I don’t have an aswer to your issue. But is the font available freely somewhere so that others could test with it? I wonder if there is an issue in the font itself.

Lemme try that again: OpenType Fonts

I’m on macOS and I tried to use the font by installing it just like you install all fonts (open the font file and select the “Install” option). It worked just fine:

All styles seem to be rendered correctly so I guess the fonts themselves are ok. What system you are on and how did you install the font files?

I’m on Ubuntu 24.10. I just tried the same thing on my wife’s laptop with the same OS and it worked fine.
Rats. I see an OS reinstallation in my future.

1 Like

You could try to uninstall and reinstall the fonts again before touching your OS installation.