Skip to content

typst css: don't wear out the "unknown font family" warning #12556

Open
@gordonwoodhull

Description

@gordonwoodhull

It's very helpful that Typst now warns about unknown fonts as of 1.12. However, it can be alarming / unhelpful for our use case.

In particular, it is a very different model from CSS font-family lists, which silently ignore missing fonts.

We can list what fonts are available for Typst with

quarto typst fonts

It takes about 5s on my Mac to list ~500 system fonts, but only 0.17s to list the 4 built-in fonts with

quarto typst fonts --ignore-system-fonts

So maybe with judicious use of --font-path and --ignore-system-paths we could quickly get a list of available fonts and then filter out the unavailable fonts when translating from CSS font-family lists to Typst font family lists.

We are already transforming these lists e.g #12542 font family lists, #11918 generic font families.

Related Typst issue: typst/typst#6010

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions