Description Usage Arguments Value Examples
View source: R/use_pkg_gfont.R
For convenience, some fonts are included in the package, you can use them without having to download them, but only few variants are available.
1 2 3 4 5 | use_pkg_gfont(
font = c("roboto", "open-sans", "lato", "montserrat", "alegreya", "nunito-sans",
"baloo", "happy-monkey", "henny-penny", "poppins", "oswald"),
selector = "body"
)
|
font |
Name of the font to use, possible choices are: |
selector |
CSS selector for which to use the font,
usually an HTML tag, default to |
An HTML tag with an htmlDependency
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | if (interactive()) {
library(gfonts)
library(htmltools)
browsable(tags$div(
use_pkg_gfont("open-sans"),
tag_example(),
tags$h1("First level title"),
tags$h2("Second level title"),
tags$h3("Third level title"),
tags$h4("Fourth level title"),
tags$h5("Fifth level title"),
tags$h6("Sixth level title")
))
browsable(tags$div(
use_pkg_gfont("henny-penny"),
tag_example(),
tags$h1("First level title"),
tags$h2("Second level title"),
tags$h3("Third level title"),
tags$h4("Fourth level title"),
tags$h5("Fifth level title"),
tags$h6("Sixth level title")
))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.