Generate CSS to import fonts
generate_css(
id,
variants = NULL,
subsets = NULL,
output = NULL,
font_dir = "../fonts/",
prefer_local_source = TRUE,
browser_support = c("best", "modern"),
...
)Id of the font, correspond to column id from get_all_fonts.
Variant of font to use.
Subsets to use.
Specifies path to output file for CSS generated.
Fonts directory relative to ouput.
Generate CSS font-face rules in which user installed fonts are
preferred. Use FALSE if you want to force the use of the downloaded font.
Browser to support, choose "best" to support
old browser or "modern" for only recent ones.
Arguments passed to crul::HttpClient$new.
a character string with CSS code (invisibly).
if (interactive()) {
# Generate CSS code to use Roboto font
cat(generate_css("roboto", "regular"))
}