quarto-dev / quarto-dev/quarto-cli

Unable to use a range of font weights with brand settings

Open
#13,338 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

brand enhancement
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

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

The brand.yml spec allows for multiple ways of specifying font weights. Originally it only allowed numbers from 100 to 900, but @gadenbuie changed that a year ago (original issue) to allow for (1) character values like "normal", "bold", "lighter", etc., and (2) ranges of values for variable width fonts (like 100..900 or 300..600), since Google and Bunny both use that syntax for importing whole ranges of fonts (like this URL for importing Open Sans 300, 400, 500, 600, 700, and 800 simultaneously: https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap)

The ability to include ranges is also included in the brand.yml documentation (at least for the Python package) here:

Image

And the example LLM prompt for generating brand.yml files also includes the syntax:

Image

However, Quarto currently doesn't allow for ranges. When trying to use a range, it triggers an error:

ERROR: ZodError: [
  {
    "code": "unrecognized_keys",
    "keys": [
      "typography"
    ],
    "path": [],
    "message": "Unrecognized key(s) in object: 'typography'"
  }
]
Steps to reproduce

Here's a reprex:

This works, but is tedious and probably inefficient:

---
title: "Variable width fonts"
brand: 
  typography: 
    fonts: 
      - family: Epunda Slab
        source: google
        weight: [300, 400, 500, 600, 700, 800, 900]
    headings: 
      family: Epunda Slab
      weight: 900
      color: "orange"
---

Here's some text

This doesn't work:

---
title: "Variable width fonts"
brand: 
  typography: 
    fonts: 
      - family: Epunda Slab
        source: google
        weight: "300..900"
    headings: 
      family: Epunda Slab
      weight: 900
      color: "orange"
---

Here's some text
Actual behavior

When rendering a document with a range in the weight key, the rendering stops with this error:

ERROR: ZodError: [
  {
    "code": "unrecognized_keys",
    "keys": [
      "typography"
    ],
    "path": [],
    "message": "Unrecognized key(s) in object: 'typography'"
  }
]

If _brand.yml is used as a separate file, there's a more informative error message:

Field "weight" has value 300..900, which must instead be one of: `100`, 
`200`, `300`, `400`, `500`, `600`, `700`, `800`, `900`, `thin`, `extra-light`, 
`ultra-light`, `light`, `normal`, `regular`, `medium`, `semi-bold`, `demi-bold`, 
`bold`, `extra-bold`, `ultra-bold`, `black`
Expected behavior

Based on the spec, the weight key should allow for ranges so that URLs like this get generated:

https://fonts.googleapis.com/css2?family=Epunda+Slab:wght@300..900&display=swap
Your environment
  • IDE: Positron 2025.09.0 build 139
  • OS: macOS Sequoia 15.6.1
Quarto check output
❯ quarto check
Quarto 1.8.20
[✓] Checking environment information...
      Quarto cache location: /Users/andrew/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.87.0: OK
      Deno version 2.3.1: OK
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.8.20
      Path: /Applications/quarto/bin

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

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/andrew/Library/TinyTeX/bin/universal-darwin
      Version: 2025

[✓] 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.1
      Path: /Users/andrew/.virtualenvs/quarto/bin/python3
      Jupyter: 5.7.2
      Kernels: python3

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

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

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the provided brand.yml typography examples and the Quarto 1.8.20 rendering reproduction as the starting point. Trace validation and font URL generation for the typography weight field, then verify that a range such as 300..900 renders successfully and produces the expected Google Fonts URL.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
design, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.