Skip to content

Variants fonts from same family can be selected using Typst Brand YAML #13548

@jimjam-slam

Description

@jimjam-slam

I have:

  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide

Bug description

I'm having trouble using a specific font, IBM Plex Sans Condensed, with Quarto and Typst. IBM Plex Sans does work. When going through the Quarto docs on missing fonts with Brand YAML, I note that some fonts might require a different name — that's definitely possible! "IBM Plex Sans Condensed" is how it appears to both R and my font book, so I'm not sure how I might vary it.

Steps to reproduce

---
title: Typst font test
format: typst
brand:
  typography:
    fonts:
      - family: IBM Plex Sans
        source: google
      - family: IBM Plex Sans Condensed
        source: google
    base: IBM Plex Sans
    headings: IBM Plex Sans Condensed
---

Ahoy there! This body renders fine with IBM Plex Sans. The heading falls back, though.

Actual behavior

The body renders successfully, but headings fall back to Libertinus following an error from Quarto and Typst:

pandoc 
  to: typst
  output-file: test.typ
  standalone: true
  shift-heading-level-by: -1
  default-image-extension: svg
  wrap: none
  citeproc: false
  variables: {}
  
metadata
  title: Typst font test
  brand:
    typography:
      fonts:
        - family: IBM Plex Sans
          source: google
        - family: IBM Plex Sans Condensed
          source: google
      base: IBM Plex Sans
      headings: IBM Plex Sans Condensed
  
[typst]: Compiling test.typ to test.pdf...warning: unknown font family: ibm plex sans condensed
    ┌─ test.typ:277:30
    │
277 │ #show heading: set text(font: ("IBM Plex Sans Condensed",), )
    │                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unknown font family: ibm plex sans condensed
    ┌─ test.typ:206:23
    │
206 │         set text(font: heading-family, weight: heading-weight, style: heading-style, fill: heading-color)
    │                        ^^^^^^^^^^^^^^

DONE

Output created: test.pdf

Checking the Quarto Typst font cache reveals that the Condensed version is not downloaded:

quarto typst fonts --variants --ignore-system-fonts --font-path .quarto/typst-font-cache/
DejaVu Sans Mono
- Style: Normal, Weight: 700, Stretch: FontStretch(1000)
- Style: Italic, Weight: 700, Stretch: FontStretch(1000)
- Style: Italic, Weight: 400, Stretch: FontStretch(1000)
- Style: Normal, Weight: 400, Stretch: FontStretch(1000)
IBM Plex Sans
- Style: Normal, Weight: 400, Stretch: FontStretch(750)
- Style: Normal, Weight: 400, Stretch: FontStretch(1000)
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)
New Computer Modern
- 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)
New Computer Modern Math
- Style: Normal, Weight: 700, Stretch: FontStretch(1000)
- Style: Normal, Weight: 450, Stretch: FontStretch(1000)
- Style: Normal, Weight: 400, Stretch: FontStretch(1000)

I have the condensed and regular versions installed on my system too, but if I just run quarto typst fonts, only the regular version (IBM Plex Sans) appears there. (R picks the Condensed version fine up, though; if I add an R figure to my Typst doc, I can use the Condensed font with systemfonts).

Downloading the TTFs from Google Fonts and specifying them directly produces the same result:

brand:
  typography:
    fonts:
      - family: IBM Plex Sans
        source: google
      - family: IBM Plex Sans Condensed
        source: file
        files:
          - path: fonts/IBMPlexSansCondensed-SemiBold.ttf

Expected behavior

Headings should render in IBM Plex Sans Condensed.

Your environment

  • IDE: VSCode 1.104.3
  • OS: macOS 26.0.1

Quarto check output

quarto check
Quarto 99.9.9
[✓] Checking environment information...
      Quarto cache location: /Users/jimjamslam/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.87.0: OK
      NOTE: Deno version 2.4.5 does not strictly match 2.3.1 and strict checking is enabled. Please use 2.3.1.
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      commit: c9c36f0add0d41a3a23b5cdcd21b407343dc6bca
      Path: /Users/jimjamslam/code/tools/quarto-cli/package/dist/bin

[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Tex:  (not detected)

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
      Source: MacOS known location

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.13.5
      Path: /opt/homebrew/opt/[email protected]/bin/python3.13
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.5.1
      Path: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources
      LibPaths:
        - /Users/jimjamslam/Library/R/arm64/4.5/library
        - /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library
      knitr: 1.50
      rmarkdown: 2.30

[✓] Checking Knitr engine render......OK

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtypstupstreamBug is in upstream library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions