choose_font: Choose an installed font from a list

View source: R/choosefont.r

choose_fontR Documentation

Choose an installed font from a list

Description

For a sequence of font family names, return the first one installed on the system. This makes it easy for code to specify a preferred font-family, but fall back to other font families if that is not installed on the system. This function acts much like the CSS font-family property.

Usage

choose_font(fonts, quiet = TRUE)

Arguments

fonts

character List of font family names to try.

quiet

logical Do not print warning if the preferred font not found.

Value

character. First font in fonts that is installed on the system or "" if none of those are installed.

Examples

choose_font(c("GillSans",  "Verdana", "sans"), quiet = TRUE)
choose_font(c("BemeboStd", "Garamond", "serif"), quiet = TRUE)

extrafont documentation built on Jan. 22, 2023, 1:53 a.m.