README.md

gfonts

CRAN
status Lifecycle:
maturing R build
status Codecov test
coverage

Download ‘Google’ fonts (via google-webfonts-helper) and generate CSS to use in rmarkdown documents and shiny applications. Some popular fonts are included and ready to use.

Installation

Install from CRAN with:

install.packages("gfonts")

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("dreamRs/gfonts")

Download a font to use it locally

Get the ID of the desired font between 1029 available :

library(gfonts)
get_all_fonts()

Download the files necessary for its use and generate the appropriate CSS code :

setup_font(
  id = "roboto",
  output_dir = "path/to"
)

Use it in {shiny} or {rmarkdown} :

use_font("roboto", "www/css/roboto.css")

:point_right: See detailed example

Included fonts

Some fonts are included in the package and ready to use :

use_pkg_gfont("roboto")

:point_right: See all fonts available

Related packages



Try the gfonts package in your browser

Any scripts or data that you put into this service are public.

gfonts documentation built on Jan. 13, 2021, 4:35 a.m.