Skip to contents

Downloads and caches the specified fonts (or default fonts) so they are available for PNG conversion without internet access.

Usage

install_fonts(
  fonts = c("Jost", "Montserrat", "Roboto", "Open Sans"),
  verbose = TRUE
)

Arguments

fonts

Character vector of Google Font names to download. Default is c("Jost", "Montserrat", "Roboto", "Open Sans").

verbose

Print status messages

Value

Named logical vector indicating success for each font

Examples

# \donttest{
install_fonts()
#> 
#> ── Downloading fonts from Google Fonts ──
#> 
#>  Requires internet connection
#>  Using curl package for downloads
#>  Downloading "Jost"...
#>  Jost (WOFF2)
#>  Downloading "Jost"...

#>  Downloading "Montserrat"... [7ms]
#> 
#>  Downloading "Montserrat"...
#>  Montserrat (WOFF2)
#>  Downloading "Montserrat"...

#>  Downloading "Roboto"... [16ms]
#> 
#>  Downloading "Roboto"...
#>  Roboto (WOFF2)
#>  Downloading "Roboto"...

#>  Downloading "Open Sans"... [12ms]
#> 
#>  Downloading "Open Sans"...
#>  Open Sans (WOFF2)
#>  Downloading "Open Sans"...

#> 
#>  Downloading "Open Sans"...

#> ── Summary 
#>  Downloading "Open Sans"...

#>  Downloaded 4/4 fonts
#>  Downloading "Open Sans"...

#>  Cache: /Users/leite/Library/Caches/org.R-project.R/R/cardargus
#>  Downloading "Open Sans"...

#>  Downloading "Open Sans"... [15ms]
#> 
install_fonts(c("Jost", "Roboto"))
#> 
#> ── Downloading fonts from Google Fonts ──
#> 
#>  Requires internet connection
#>  Using curl package for downloads
#>  Downloading "Jost"...
#>  Jost (WOFF2)
#>  Downloading "Jost"...

#>  Downloading "Roboto"... [5ms]
#> 
#>  Downloading "Roboto"...
#>  Roboto (WOFF2)
#>  Downloading "Roboto"...

#> 
#>  Downloading "Roboto"...

#> ── Summary 
#>  Downloading "Roboto"...

#>  Downloaded 2/2 fonts
#>  Downloading "Roboto"...

#>  Cache: /Users/leite/Library/Caches/org.R-project.R/R/cardargus
#>  Downloading "Roboto"...

#>  Downloading "Roboto"... [20ms]
#> 
# }