Skip to content

Brand fonts from file not picked up by HTML-based formats #12501

@mcanouil

Description

@mcanouil

Bug description

It seems using fonts from file via brand.yml is not working for HTML-based formats.
It does work as expected for Typst assuming the "family" name is the same as the one encoded on the font file.

Steps to reproduce

https://github.com/mcanouil/quarto-issues-experiments/tree/main/quarto-cli-12501

Actual behavior

No fonts imported.

From Garrick:

I can repro using Mickaël’s test-brand-font example. If I take out embed-resources: true and when using a Google font, the compiled bootstrap css has an @import rule as the first line, but with just the source: file font definition there’s no @import rule.
It does work as expected in a Shiny app, but we have a special code path for local files that uses htmltools::HTMLDependency() for the font files and CSS. Here’s a small example app for reference

library(shiny)
library(bslib)

ui <- page_fixed(
  h2("My Shiny App"),
  lorem::ipsum(2)
)

shinyApp(ui, function(...) {})

Quarto check output

Quarto 99.9.9
[✓] Checking environment information...
      Quarto cache location: /Users/mcanouil/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.85.1: OK
      Deno version 1.46.3: OK
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      commit: 36e704c159d44ad041b819494e3c59fbdeaa5676
      Path: /Users/mcanouil/Projects/quarto-dev/quarto-cli/package/dist/bin

[✓] Checking tools....................OK
      TinyTeX: v2025.03.10
      Chromium: (not installed)

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

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
      Source: QUARTO_CHROMIUM

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

[✓] Checking Python 3 installation....OK
      Version: 3.13.2
      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...........ℹ R version 4.4.3 (2025-02-28)
! Config '~/.Rprofile' was loaded!
[✓] Checking R installation...........OK
      Version: 4.4.3
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
      knitr: 1.50
      rmarkdown: 2.29

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

Metadata

Metadata

Labels

brand`_brand.yml`bugSomething isn't workinghtmlIssues with HTML and related web technology (html/css/scss/js)revealjsIssues with the revealjs formattriaged-toIssues that were not self-assigned, signals that an issue was assigned to someone.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions