Specify a collection of font families. The first font family supported by the relevant device (i.e., the device that is open, or will be opened, at plotting time) is used by thematic. If a given font family is not supported by the default, but is a Google Font and install = TRUE, the font will be downloaded, cached, and registered for use the showtext and ragg packages.

font_spec(
  families = "",
  scale = 1,
  install = is_installed("ragg") || is_installed("showtext"),
  update = FALSE,
  quiet = TRUE
)

Arguments

families

a character vector of font families.

scale

numerical constant applied to font sizes.

install

whether to download and register font families available via Google Fonts (but unavailable to R). After a successful download, fonts are cached (in a directory which can be managed via font_cache_set()), and registered for use with the showtext and ragg packages. If installation fails with a valid internet connection, you may need to fetch the latest Google Font information prior to installation (i.e., set update = TRUE).

update

if TRUE, the latest Google Fonts are fetched and any out-dated font cache is updated. Fetching the latest fonts requires a Google Font API key (one is bundled with the package, but you can set your own via an environment variable, GFONT_KEY).

quiet

whether to suppress download messages.

Value

the input arguments as a list.

See also