Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font-weight name incompatibility in Typst #11726

Open
kazuyanagimoto opened this issue Dec 22, 2024 · 1 comment
Open

Font-weight name incompatibility in Typst #11726

kazuyanagimoto opened this issue Dec 22, 2024 · 1 comment
Assignees
Labels
brand `_brand.yml` bug Something isn't working typst
Milestone

Comments

@kazuyanagimoto
Copy link

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/[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.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

@kazuyanagimoto kazuyanagimoto added the bug Something isn't working label Dec 22, 2024
@mcanouil mcanouil added typst brand `_brand.yml` labels Dec 22, 2024
@gordonwoodhull
Copy link
Contributor

gordonwoodhull commented Dec 23, 2024

Thanks for the report!

As a temporary workaround until this is fixed, you could use 600.

Looks like we are just passing weight through, when we need another _quarto.modules.typst.css conversion function for weight, as Typst does not have the dashes or the synonyms.

Probably worth a backport.

@gordonwoodhull gordonwoodhull self-assigned this Dec 23, 2024
@gordonwoodhull gordonwoodhull added this to the v1.7 milestone Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brand `_brand.yml` bug Something isn't working typst
Projects
None yet
Development

No branches or pull requests

3 participants