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
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
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-familylists, which silently ignore missing fonts.We can list what fonts are available for Typst with
It takes about 5s on my Mac to list ~500 system fonts, but only 0.17s to list the 4 built-in fonts with
So maybe with judicious use of
--font-pathand--ignore-system-pathswe could quickly get a list of available fonts and then filter out the unavailable fonts when translating from CSSfont-familylists 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