Skip to content

In custom typst format extension, relative or project relative font-paths not working #13745

@cderv

Description

@cderv

Discussed in https://github.com/orgs/quarto-dev/discussions/13742

Originally posted by the-solipsist December 1, 2025

Description

I have an custom extension in which I use font-paths. If I use an absolute font-path, the fonts get picked up. If I use a relative font path, they don't.

title: lirneasia
author: Pranesh Prakash
version: 1.0.0
quarto-required: ">=1.8.0"
contributes:
  metadata:
    project:
      brand: brand.yml
  formats:
    typst:
      template-partials:
        - typst-template.typ
        - typst-show.typ
        - page.typ
      font-paths: 
        - assets/fonts # doesn't work
        - /_extensions/lirneasia/assets/fonts # doesn't work
        # - /home/sol/documents/tmp/_extensions/lirneasia/assets/fonts
        # the absolute path works.
      format-resources:
        - assets/logos

The CI fails in this repo. (If anyone has any other comments about how that repo is organized, or the Typst template I've written, or anything else, I'm very happy to receive feedback.)

I found this issue, but it doesn't seem to explain what's going on: #12695

The output of quarto render seems to be okay, but still the fonts don't get recognized.

...
metadata
  font-paths:
    - ../../_extensions/lirneasia/assets/fonts
    - /_extensions/lirneasia/assets/fonts
...

The error:

[typst]: Compiling d4dasia_country-report_sl.typ to d4dasia_country-report_sl.pdf...warning: unknown font family: montserrat
    ┌─ country/sl/d4dasia_country-report_sl.typ:612:30
    │
612 │ #show heading: set text(font: ("Montserrat",), weight: "bold", fill: rgb("#a51212"), )
    │                               ^^^^^^^^^^^^^^^

warning: unknown font family: aptos
    ┌─ country/sl/d4dasia_country-report_sl.typ:283:10
    │
283 │     font: font,
    │           ^^^^

warning: unknown font family: montserrat
    ┌─ country/sl/d4dasia_country-report_sl.typ:428:23
    │
428 │         set text(font: heading-family, weight: heading-weight, style: heading-style, fill: heading-color)
    │                        ^^^^^^^^^^^^^^

If I uncomment the absolute path, the fonts get recognized when I do quarto render:

...
metadata
  font-paths:
    - ../../_extensions/lirneasia/assets/fonts
    - /_extensions/lirneasia/assets/fonts
    - /home/sol/documents/tmp/_extensions/lirneasia/assets/fonts
...
```</div>

Metadata

Metadata

Labels

bugSomething isn't workingextensionsrelates to Quarto extensions mechanismtypst

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions