Skip to content

Font-weight name incompatibility in Typst #11726

Closed
@kazuyanagimoto

Description

@kazuyanagimoto

Bug description

In brands.yml, if I specify the font-weight semibold, I got the following error from Quarto

ERROR: Validation of YAML front matter failed.
ERROR: In file Untitled.qmd
(line 11, columns 15--22) Field "weight" has value semibold, 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`
10:       family: Roboto
11:       weight: semibold
                 ~~~~~~~~
12: ---
ℹ Did you mean semi-bold?

However, if I specify the font-weight semi-bold, I get the following error from Typst

[typst]: Compiling Untitled.typ to Untitled.pdf...error: expected integer, "thin", "extralight", "light", "regular", "medium", "semibold", "bold", "extrabold", or "black"
    ┌─ Untitled.typ:292:48
    │
292 │ #show heading: set text(font: "Roboto", weight: "semi-bold", )

Here, we can see the incompatibility of the font-weight names.

Steps to reproduce

This is a minimal example.

---
format: typst
brand:
  typography:
    fonts:
      - family: Roboto
        source: google
    base: Roboto
    headings:
      family: Roboto
      weight: semi-bold
---

## Heading

Expected behavior

No response

Actual behavior

No response

Your environment

No response

Quarto check output

Quarto 1.6.39
[✓] Checking environment information...
Quarto cache location: /Users/kazuharu/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.4.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.46.3: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.6.39
Path: /Applications/quarto/bin

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

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

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

[✓] Checking Python 3 installation....OK
Version: 3.13.1
Path: /opt/homebrew/opt/python@3.13/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.4.2
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Users/kazuharu/github/quarto-clean-typst/renv/library/macos/R-4.4/aarch64-apple-darwin20
- /Users/kazuharu/Library/Caches/org.R-project.R/R/renv/sandbox/macos/R-4.4/aarch64-apple-darwin20/f7156815
knitr: 1.48
rmarkdown: 2.28

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

Metadata

Metadata

Labels

brand`_brand.yml`bugSomething isn't workingtypst

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions