powered by
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"), ... )
a character string with CSS code (invisibly).
Id of the font, correspond to column id from get_all_fonts.
id
get_all_fonts
Variant of font to use.
Subsets to use.
Specifies path to output file for CSS generated.
Fonts directory relative to ouput.
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.
FALSE
Browser to support, choose "best" to support old browser or "modern" for only recent ones.
"best"
"modern"
Arguments passed to crul::HttpClient$new.
crul::HttpClient$new
if (interactive()) { # Generate CSS code to use Roboto font cat(generate_css("roboto", "regular")) }
Run the code above in your browser using DataLab