showtext: Using System Fonts in R Graphics

Abstract:

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.

Cite PDF Tweet

Author

Affiliation

Yixuan Qiu

 

Published

May 28, 2015

Received

Oct 26, 2014

DOI

10.32614/RJ-2015-008

Volume

Pages

7/1

99 - 108

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

Footnotes

    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, "The R Journal: showtext: Using System Fonts in R Graphics", The R Journal, 2015

    BibTeX citation

    @article{RJ-2015-008,
      author = {Qiu, Yixuan},
      title = {The R Journal: 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}
    }