knitr::opts_chunk$set( collapse = TRUE, comment = "#>", warning = FALSE, message = FALSE )
library(gfonts)
9 fonts are included in {gfonts} and ready to use! Here's a comparison, more examples below.
library(htmltools) style <- "border: 1px dashed #112446; padding: 10px;" citation <- "Faites des b\u00eatises, mais faites-les avec enthousiasme." tags$div( style = paste0( "display: grid;", "grid-template-columns: repeat(3, 1fr);", "grid-template-rows: repeat(3, 1fr);", "grid-column-gap: 10px;","grid-row-gap: 10px;" ), lapply( X = c("roboto", "open-sans", "lato", "montserrat", "alegreya", "nunito-sans", "baloo", "happy-monkey", "henny-penny", "poppins", "oswald"), FUN = function(x) { tags$div( class = paste0("example-", x), style = style, title = x, citation ) } ) )
use_pkg_gfont("roboto", selector = ".example-roboto")
tag_example("example-roboto")
use_pkg_gfont("open-sans", selector = ".example-open-sans")
tag_example("example-open-sans")
use_pkg_gfont("lato", selector = ".example-lato")
tag_example("example-lato")
use_pkg_gfont("montserrat", selector = ".example-montserrat")
tag_example("example-montserrat")
use_pkg_gfont("alegreya", selector = ".example-alegreya")
tag_example("example-alegreya")
use_pkg_gfont("nunito-sans", selector = ".example-nunito-sans")
tag_example("example-nunito-sans")
use_pkg_gfont("baloo", selector = ".example-baloo")
tag_example("example-baloo")
use_pkg_gfont("happy-monkey", selector = ".example-happy-monkey")
tag_example("example-happy-monkey")
use_pkg_gfont("henny-penny", selector = ".example-henny-penny")
tag_example("example-henny-penny")
use_pkg_gfont("poppins", selector = ".example-poppins")
tag_example("example-poppins")
use_pkg_gfont("oswald", selector = ".example-oswald")
tag_example("example-oswald")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.