How to use Arial Narrow font in Typst?

How to use Arial Narrow font? I have a customized font:

https://truefonts.net/fonts/arial-narrow/#:~:text=Download%20arial%20narrow%20TrueType%20font%20for%20free%20from,personal%20use.%20Explore%20more%20fonts%20like%20arial%2C%20narrow.

Seems the typst compiler cannot use it. Help!

Detail configuration:
I tried local compilation. This font has been install but when I use “typst fonts” it (Arial Narrow) is not listed. I was trying to directly use this .ttf file with the setup:

(a) Attempt A:

#set text(
    font: "arial-narrow",
    size: 12pt,
)

(b) Attempt B:

#set text(
    font: "Arial Narrow",
    size: 12pt,
)

Unfortunately, neither works:
image

This .ttf file is in the same folder. When using local compiler, the command is:

typst compile --font-path . main.typ main.pdf

I am using MACOS 15.6.1.

Hi and welcome! Could you describe your situation in more detail? Are you using the app or a local installation? Have you installed the font or copied the font somewhere? More general: what have you done to use the font from Typst.

Could you also try to revise your post’s title to be a complete question as per the question guidelines:

Good titles are questions you would ask your friend about Typst.

A good title makes the topic easier to grasp, increasing your chances of getting a good answer quickly. Adding tags such as web-app (if applicable) and fonts will also help. We also hope by adhering to this, we make the information in this forum easy to find in the future.

Finally, take a look at this question to see if it helps you resolve your issue:

I hope we can resolve your issue soon. Thanks!

1 Like

Thanks! I have revised the question with details.

typst somehow registers the font as “Arial”.

You can check the font with

typst fonts --font-path . --ignore-system-fonts

To use the font you can set

#set text(
  font: "Arial",
  size: 12pt,
)

The quick brown fox jumps over the lazy dog.

then use

typst compile --font-path . main.typ main.pdf --ignore-system-fonts

As @SillyFreak suggests the proper way to specify a font variant should be setting the stretch (and other) parameter.

Typsts lists the “Arial Narrow” font as

$ typst fonts --font-path . --ignore-system-fonts --variants
Arial
- Style: Normal, Weight: 400, Stretch: FontStretch(750)

By explicitly setting the style, weight and stretch parameters I don’t need to add --ignore-system-fonts to exclude other Arial variants installed on the system.

#set text(
  font: "Arial",
  style: "normal",
  weight: 400,
  stretch: 75%,
  size: 12pt,
)
typst compile --font-path . main.typ main.pdf
1 Like

Perfectly solved! I see some other fonts (like Roboto Condensed) have similar behaviors. Hope typst will improve on this. Tons of thanks!

I’m not an expert on fonts, but I think what’s going on is that “Arial Narrow” is a variant of “Arial” with certain parameters (I assume here it’s a different stretch). The way to select that font is to use the base font’s name, and adjust the parameter.

you can use typst fonts --variants --font-path . to see what font family and settings your Arial Narrow font has. I don’t have it installed but here’s what I get for one of the built-in fonts:

$ typst fonts --ignore-system-fonts --variants
Libertinus Serif
- Style: Normal, Weight: 400, Stretch: FontStretch(1000)
- Style: Normal, Weight: 700, Stretch: FontStretch(1000)
- Style: Italic, Weight: 400, Stretch: FontStretch(1000)
- Style: Italic, Weight: 700, Stretch: FontStretch(1000)
- Style: Normal, Weight: 600, Stretch: FontStretch(1000)
- Style: Italic, Weight: 600, Stretch: FontStretch(1000)

So if you have both Arial and Arial Narrow, you’ll probably need to set the stretch as well to prevent Typst from choosing Arial. I think this issue is related to your (and @dance5295’s) expectation of using the name “Arial Narrow”: Also select font via unprettified family name · Issue #2098 · typst/typst · GitHub