.onAttach <- function(libname, pkgname) {
if (.Platform$OS.type == "windows") { # nocov start
if (interactive()) packageStartupMessage("Registering Windows fonts with R")
extrafont::loadfonts("win", quiet = TRUE)
}
if (getOption("ewenthemes.loadfonts", default = FALSE)) {
if (interactive()) packageStartupMessage("Registering PDF & PostScript fonts with R")
extrafont::loadfonts("pdf", quiet = TRUE)
extrafont::loadfonts("postscript", quiet = TRUE)
}
fnt <- extrafont::fonttable()
if (!any(grepl("Work[ ]Sans", fnt$FamilyName))) {
packageStartupMessage("NOTE: Work Sans fonts are required to use some themes.")
packageStartupMessage(" Please use ewenthemes::import_work_sans() to install Work Sans.")
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.