showtext: Using System Fonts in R Graphics

This article introduces the showtext package that makes it easy to use system fonts in R graphics. Unlike other methods to embed fonts into graphics, showtext converts text into raster images or polygons, and then adds them to the plot canvas. This method produces platform-independent image files that do not rely on the fonts that create them. It supports a large number of font formats and R graphics devices, and meanwhile provides convenient features such as using web fonts and integrating with knitr. This article provides an elaborate introduction to the showtext package, including its design, usage, and examples.

Yixuan Qiu
2015-05-29

CRAN packages used

extrafont, showtext, knitr, Cairo, Rttf2pt1, sysfonts, RCurl, jsonlite, ggplot2, xkcd, RSvgDevice

CRAN Task Views implied by cited packages

Graphics, WebTechnologies, Phylogenetics, ReproducibleResearch

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".

Citation

For attribution, please cite this work as

Qiu, "showtext: Using System Fonts in R Graphics", The R Journal, 2015

BibTeX citation

@article{RJ-2015-008,
  author = {Qiu, Yixuan},
  title = {showtext: Using System Fonts in R Graphics},
  journal = {The R Journal},
  year = {2015},
  note = {https://doi.org/10.32614/RJ-2015-008},
  doi = {10.32614/RJ-2015-008},
  volume = {7},
  issue = {1},
  issn = {2073-4859},
  pages = {99-108}
}