As a side-effect, a warning will be thrown if none of the choices are installed.

choose_first_installed_font(choices, verbose = FALSE)

Arguments

choices

character, vector of font family names

verbose

logical, whether to display chosen font

Value

the first installed font from choices, or failing that, "sans"

Examples

if (interactive()) {
  print(choose_first_installed_font(c("Blah blah", "Arial", "Another made-up font")))
}