typst: Failure to select right font variant

When using the following fonts, Typst fails to select the right variant.

QuadraatPro.otf
QuadraatPro-Ita.otf
QuadraatPro-Demibold.otf
QuadraatPro-DemiboldItalic.otf
QuadraatPro-Bold.otf
QuadraatPro-BoldIta.otf

#set text(font: "Quadraat Pro") selects Quadraat Pro Italic. I did not manage to get the Regular style. Names in the system are: Regular, Italic, Demibold, Demibold Italic, Bold, Bold Italic.

_Originally posted by @owiecc in https://github.com/typst/typst/issues/185#issuecomment-1483411869_

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 3
  • Comments: 15 (8 by maintainers)

Most upvoted comments

I have a similar problem with googles Rubik font. It shows up as installed in Windows with numerous variants, but typst fonts --variants only finds one normal and italic. Consequently, specifying the font weight changes nothing.

This issue has become the-issue-to-points-to of font selecting problem, and PR #3228 now provides a mechanism to solve the it. I propose to close this issue, and open per-font issue separately, to track whether a font with wrong metadata has been added to exception list.

That makes sense. I don’t really know which of these fonts are fixed and which are not, so if someone knows that a particular fonts is still unfixed, feel free to open an issue for that one.

This issue has become the-issue-to-points-to of font selecting problem, and PR #3228 now provides a mechanism to solve the it. I propose to close this issue, and open per-font issue separately, to track whether a font with wrong metadata has been added to exception list. cc @Enivex

Using “Source Sans Pro” in the online editor works, i.e., *strong* causes a bold font. On my machine, the same code does not produce a bold font (I even manually installed the bold variant).

The following fonts are found with typst fonts --variants, which looks a little odd to me:

Source Sans Pro
- Style: Normal, Weight: 400, Stretch: 100%
- Style: Normal, Weight: 900, Stretch: 100%
- Style: Italic, Weight: 900, Stretch: 100%
- Style: Normal, Weight: 700, Stretch: 100%
- Style: Italic, Weight: 700, Stretch: 100%
- Style: Normal, Weight: 200, Stretch: 100%
- Style: Italic, Weight: 200, Stretch: 100%
- Style: Italic, Weight: 400, Stretch: 100%
- Style: Normal, Weight: 300, Stretch: 100%
- Style: Italic, Weight: 300, Stretch: 100%
- Style: Normal, Weight: 600, Stretch: 100%
- Style: Italic, Weight: 600, Stretch: 100%