Offline 'Google' Fonts for 'Markdown' and 'Shiny'

Download 'Google' fonts and generate 'CSS' to use in 'rmarkdown' documents and 'shiny' applications. Some popular fonts are included and ready to use.


gfonts

CRANstatus R-CMD-check Codecov testcoverage

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("remotes")
remotes::install_github("dreamRs/gfonts")

Download a font to use it locally

Get the ID of the desired font between 1955 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

  • Package googlefontR provides helper functions to ease the use of Google Fonts with R.
  • Package showtext makes it easy to use various types of fonts (TrueType, OpenType, Type 1, web fonts, etc.) in R graphs.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("gfonts")

0.2.1 by Victor Perrier, 12 days ago


https://dreamrs.github.io/gfonts/, https://github.com/dreamRs/gfonts


Report a bug at https://github.com/dreamRs/gfonts/issues


Browse source code at https://github.com/cran/gfonts


Authors: Victor Perrier [aut, cre] , Fanny Meyer [aut] , Mario Ranftl [ctb, cph] (google-webfonts-helper)


Documentation:   PDF Manual  


GPL-3 license


Imports utils, htmltools, shiny, crul, jsonlite, glue, crayon

Suggests knitr, rmarkdown, testthat, vcr, covr


Imported by ggfootball, indiedown, movedesign.

Suggested by cardargus, gdtools.


See at CRAN