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

All brand.typography.fonts should be made available in websites #11929

Open
gadenbuie opened this issue Jan 22, 2025 · 2 comments
Open

All brand.typography.fonts should be made available in websites #11929

gadenbuie opened this issue Jan 22, 2025 · 2 comments
Assignees
Labels
backport brand `_brand.yml` bug Something isn't working

Comments

@gadenbuie
Copy link
Collaborator

gadenbuie commented Jan 22, 2025

Bug description

When brand.typography.fonts includes additional fonts that aren't used in brand.typography.{base,headings,monospace,...} these additional fonts should still be loaded and made available in websites.

Steps to reproduce

---
title: Load all brand fonts

brand:
  typography:
    fonts:
      - family: Barrio
        source: google
      - family: Roboto
        source: google
    base: Roboto
    # headings: Barrio
---

## Base font

{{< lipsum 1 >}}

## Barrio font

::: {style="font-family: Barrio"}
{{< lipsum 1 >}}
:::

Expected behavior

The second paragraph should be in Barrio font (very distinctive), without Barrio having to appear in any of the family keys in brand.typography.

Image

Actual behavior

The Barrio font isn't loaded and isn't available in the website.

Image

If brand.typography.headings: Barrio, then the Barrio font is loaded, which should not be necessary.

Your environment

  • OS: MacOS Sequoia 15.2

Quarto check output

Quarto 1.7.13
[✓] Checking environment information...
      Quarto cache location: /Users/garrick/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.7.13
      Path: /Users/garrick/.local/share/qvm/versions/v1.7.13/bin

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

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

[✓] 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.12.2
      Path: /Users/garrick/work/posit-dev/brand-yml/.venv/bin/python
      Jupyter: 5.7.2
      Kernels: python3

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

[✓] Checking R installation...........OK
      Version: 4.4.2
      Path: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources
      LibPaths:
        - /Users/garrick/Library/R/arm64/4.4/library
        - /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
      knitr: 1.49
      rmarkdown: 2.29

[✓] Checking Knitr engine render......OK
@gadenbuie gadenbuie added the bug Something isn't working label Jan 22, 2025
@gadenbuie
Copy link
Collaborator Author

Another way this would fail is to include Barrio in headings.family, but with fallback fonts:

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

Image

@mcanouil mcanouil added the brand `_brand.yml` label Jan 22, 2025
@gordonwoodhull
Copy link
Contributor

gordonwoodhull commented Jan 22, 2025

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 for Typst.

(moved to #11933)

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
Projects
None yet
Development

No branches or pull requests

4 participants