maison uses three free Google families: Hanken Grotesk (sans, the default for charts), Newsreader (serif) and IBM Plex Mono (monospace). It draws text through systemfonts, which devices such as ragg use, and never bundles font files.
Value
find_maison_fonts() returns, invisibly, a named logical
vector: TRUE for each family that is available. check_maison_fonts()
returns, invisibly, the names of the missing families.
Details
find_maison_fonts() looks for the families and returns which of them
the current R session can use. check_maison_fonts() reports on them and
says how to install any that are missing. Neither registers or installs
anything.
A font installed on the machine needs no registration: systemfonts finds it
by family name. That is also why a licensed face such as Aktiv Grotesk
works whenever it is installed. find_maison_fonts() first asks
systemfonts to rescan the two folders it side-loads fonts from, ./fonts
in the project and ~/fonts for the user, so fonts placed there since the
session started are found too.
systemfonts::get_from_google_fonts() downloads to ~/fonts by default.
Fonts are resolved per R session, and quarto render starts a new session
for each document, so call set_maison() (which calls
find_maison_fonts()) in each document's setup chunk. To see the fonts
in rendered figures, use a systemfonts-aware device such as
ragg::agg_png() (dev: ragg_png in knitr).
Examples
check_maison_fonts()
#> ✖ Missing: "Hanken Grotesk", "Newsreader", and "IBM Plex Mono". Text set in a
#> missing family is drawn in a fallback font.
#> ℹ Hanken Grotesk: install it from
#> https://fonts.google.com/specimen/Hanken+Grotesk, or run
#> `systemfonts::get_from_google_fonts("Hanken Grotesk")`.
#> ℹ Newsreader: install it from https://fonts.google.com/specimen/Newsreader, or
#> run `systemfonts::get_from_google_fonts("Newsreader")`.
#> ℹ IBM Plex Mono: install it from
#> https://fonts.google.com/specimen/IBM+Plex+Mono, or run
#> `systemfonts::get_from_google_fonts("IBM Plex Mono")`.
check_maison_fonts("Aktiv Grotesk")
#> ✖ Missing: "Aktiv Grotesk". Text set in a missing family is drawn in a fallback
#> font.
#> ℹ Aktiv Grotesk: install it on this machine, then restart R.