Using Playfair variable font

Using Typst 0.15.1, I’m trying to use Playfair variable font (ttf files downloaded from same Github repo as issue below).
The issue I have is that only “Playfair Micro” is available, and not other variants (e.g. “Title”, “Thin”, “Display”, etc…). These variants are quite different, especially since “Micro” intended use seems to be at very small font size (5pt). There is an open issue seemingly related on the font repo (here), I’m still not sure if that is a limitation of the font or of Typst, and what workaround could be used. I tried extracting a static font with “opsz” at e.g. 12pt with fonttoolslike in this post, but I get the exact same render (and same “Playfair Micro” name). In e.g. TextEdit I can see all the variants.

For comparison, here is what I get in TextEdit, using Playfair Title, at 12pt, saved to pdf:

Capture d’écran 2026-10-12 à 11.16.51

An here is what I get with Typst, using the only option Playfair Micro, again 12pt (normal weight):

image

The lines are thicker (especially horizontal ones), as well as serifs (quite striking on p and q).

My font knowledge is quite limited, so I’m not sure how to work around this issue, any help would be appreciated, thanks!

Hi, welcome to the forum!

You can inspect what Typst knows with typst fonts --variants. As shown below, PlayfairRomanVF.ttf indeed provides only a single font named Playfair Micro, and it supports optical sizes from 5 pt to 1200 pt.

$ typst fonts --variants
Playfair Micro
  └ …/PlayfairRomanVF.ttf (Variable)
      Style: Normal
      Weight: 360-900 (Default: 360)
      Stretch: 88%-113% (Default: 88%)
      Optical Size: 5pt-1200pt (Default: 5pt)
…

I can’t try TextEdit, but I guess you actually choose an optical size larger than 12 pt by selecting the Title version.

In Typst, the optical size is synced with the actual size by default. You can use text(variations: (opsz: number-of-points)) to change that. For example:

#set text(12pt, font: "Playfair Micro", variations: (opsz: 50))
// actual size: 12 pt; optical size: 50pt.

Comparisons:

actual+optical 12 pt               actual+optical 50 pt
actual 12 pt, optical 50 pt     actual 50 pt, optical 12 pt

Full code
#set text(12pt, font: "Playfair Micro")
#set page(width: auto, height: auto, margin: 1em)

#table(
  columns: 2,
  stroke: none,

  [De ces jours. #lorem(5)],
  text(50pt)[De ces jours. #lorem(5)],
  text(variations: (opsz: 50))[De ces jours. #lorem(5)],
  text(50pt, variations: (opsz: 10))[De ces jours. #lorem(5)],
)

By the way, when testing opsz, it might be better to print it on physical paper before comparison.

Thank you for your answer, that got me on the right track! I got confused about the different names, but everything is actually available in Typst.

After playing around with fonttools I manage to get the actual definitions of all these font variants, which are just variations on opsz, wdth and wght (didn’t know that), e.g.:

Micro {'opsz': 5.0, 'wdth': 100.0, 'wght': 400.0}
Regular {'opsz': 12.0, 'wdth': 100.0, 'wght': 400.0}
Headline {'opsz': 32.0, 'wdth': 100.0, 'wght': 400.0}

I’ll just use text(variations: ...) to get what I want.