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

typst brand yaml: handle lists of fonts in typography element definitions #11933

Open
gordonwoodhull opened this issue Jan 22, 2025 · 0 comments
Assignees
Labels
backport brand `_brand.yml` bug Something isn't working typst

Comments

@gordonwoodhull
Copy link
Contributor

gordonwoodhull commented Jan 22, 2025

Split out from #11929

---
brand:
  typography:
    fonts:
      - family: Barrio
        source: google
      - family: Roboto
        source: google
    base: Roboto
    headings: Barrio, Times New Roman
---

## Base font

{{< lipsum 1 >}}

## Heading is `#context text.font`{=typst}

Base is `#context text.font`{=typst}

::: {style="font-family: Barrio"}
{{< lipsum 1 >}}
:::
#show heading: set text(font: ("Barrio", "Times New Roman"))

Typst passes the first test, since caching of font resources is independent of what is used.

But it fails the second test due to not anticipating a list. 🤦

Producing

#show heading: set text(font: "Barrio, Times New Roman", )

which should be

#show heading: set text(font: ("Barrio", "Times New Roman"))
## Heading is `#context text.font`{=typst}

produces

Image

But it's really Typst's global fallback font, Linux Libertine. 😝

Very important for multilingual text, will fix and backport.

Originally posted by @gordonwoodhull in #11929

@gordonwoodhull gordonwoodhull self-assigned this Jan 22, 2025
@gordonwoodhull gordonwoodhull added bug Something isn't working backport typst brand `_brand.yml` labels Jan 22, 2025
@gordonwoodhull gordonwoodhull changed the title typst should handle lists of fonts in typography element definitions typst brand yaml: handle lists of fonts in typography element definitions Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport brand `_brand.yml` bug Something isn't working typst
Projects
None yet
Development

No branches or pull requests

1 participant