EVOLUTION-MANAGER
Edit File: font_face.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Helpers for importing web fonts</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for font_face {bslib}"><tr><td>font_face {bslib}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Helpers for importing web fonts</h2> <h3>Description</h3> <p><code>font_google()</code>, <code>font_link()</code>, and <code>font_face()</code> are all re-exported from the <span class="pkg">sass</span> package (see <code><a href="../../sass/html/font_face.html">sass::font_face()</a></code> for details). For a quick example of how to use these functions with <code><a href="bs_theme.html">bs_theme()</a></code>, see the examples section below. </p> <h3>Examples</h3> <pre> # If you have an internet connection, running the following code # will download, cache, and import the relevant Google Font files # for local use theme <- bs_theme( base_font = font_google("Fira Sans"), code_font = font_google("Fira Code"), heading_font = font_google("Fredoka One") ) if (interactive()) { bs_theme_preview(theme) } # Three different yet equivalent ways of importing a remotely-hosted Google Font a <- font_google("Crimson Pro", wght = "200..900", local = FALSE) b <- font_link( "Crimson Pro", href = "https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@200..900" ) url <- "https://fonts.gstatic.com/s/crimsonpro/v13/q5uDsoa5M_tv7IihmnkabARboYF6CsKj.woff2" c <- font_face( family = "Crimson Pro", style = "normal", weight = "200 900", src = paste0("url(", url, ") format('woff2')") ) theme <- bs_theme(base_font = c) if (interactive()) { bs_theme_preview(theme) } </pre> <hr /><div style="text-align: center;">[Package <em>bslib</em> version 0.4.0 <a href="00Index.html">Index</a>]</div> </body></html>