qmd-lab / closeread

https://closeread.dev
MIT License
128 stars 5 forks source link

Minard mainfont not taking properly #114

Open jimjam-slam opened 3 weeks ago

jimjam-slam commented 3 weeks ago

Something I observed polishing up the YAML options is that the mainfont option appears to be escaped differently to how our font options are. It's causing the custom font for the Minard example not to take properly:

image

vs.

image

In the doc root, you can observe the variables:

--cr-narrative-font-family: et-book, Palatino, “Palatino Linotype”, “Palatino LT STD”, “Book Antiqua”, Georgia, serif;

[...]

--bs-body-font-family: et-book, Palatino, "" Palatino Linotype "", "" Palatino LT STD "", "" Book Antiqua "", Georgia, serif;

Not really sure why this is, or if I'm escaping improperly in the YAML 🤔

andrewpbray commented 3 weeks ago

Good catch. Something we should be able to figure out with some sleuthing! I'll go ahead and move this to post-contest (or at least post-announcement), since it's non-urgent.

jimjam-slam commented 3 weeks ago

I'm actually staring to suspect, based on the HTML reference, that the mainfont option is not designed to take a full comma-separated list of fallback fonts.

Following this up with the Quarto team!

jimjam-slam commented 3 weeks ago

Have filed as https://github.com/quarto-dev/quarto-cli/discussions/11268 (not an issue because I'm not sure whether it's intended behaviour from Quarto)

jimjam-slam commented 3 weeks ago

I think the short-term might just be to list mainfont: et-book alone, though! Since it's hosted locally, it seems unlikely that the page would be available but not the font.

andrewpbray commented 1 week ago

When I try this, I'm getting the navbar in et-book; it's overwriting cosmo, which makes sense. Should we just return to calling the font in the css file?

jimjam-slam commented 2 days ago

This is now fixed in the latest Quarto pre-release: it turns out that they do the quoting for you, and if you quote font names yourself, they were doubling them up. The solution was to simply leave the quotes out and let Quarto add them, but as of v1.6.34 this is fixed.

That said, as you say, specifying mainfont on the doc overwrites the font for the navigation chrome too, not just the article. So I agree: let's return to specifying the custom font in the CSS :)

andrewpbray commented 2 days ago

Ahhh, interesting. Well good to know!

jimjam-slam commented 2 days ago

Fix in #146 — it's pretty small!