Adds a Google Font from https://fonts.google.com/ and activate the showtext package. This function is particularly useful for using Google Fonts for [createLogo]createLogo.

activate_google_font(
  name,
  regular.wt = 400,
  bold.wt = 700,
  repo = "http://fonts.gstatic.com/",
  db_cache = TRUE,
  handle = curl::new_handle()
)

Arguments

name

name of the font that will be searched in Google Fonts

regular.wt

font weight for the regular font face, usually 400

bold.wt

font weight for the bold font face, usually 700

repo

the site that hosts the font files. Default is the official repository http://fonts.gstatic.com/ provided by Google Fonts.

db_cache

whether to obtain font metadata from a cache site. Using cache is typically faster, but not as update-to-date as using the official API. If db_cache is set to FALSE, then metadata are retrieved from the Google Fonts API.

handle

a curl handle object passed to curl::curl_download().

See also