Learn R Programming

gdtools (version 0.5.0)

font_set: Create a font set

Description

Bundle font registration, HTML dependencies, and font family names into a single object. Each argument accepts a font_google() specification, a font_liberation() specification, or a plain character string naming a system font already available.

The returned object provides fields ready to use with ggplot2::theme() ($sans, $serif, $mono), girafe(fonts = ...) or dsvg(fonts = ...) ($dsvg_fonts), and girafe(dependencies = ...) ($dependencies).

Usage

font_set(sans = NULL, serif = NULL, mono = NULL, symbol = NULL)

Value

An object of class font_set with elements:

sans

character, the sans font family name (or NULL)

serif

character, the serif font family name (or NULL)

mono

character, the mono font family name (or NULL)

symbol

character, the symbol font family name (or NULL)

dependencies

list of htmlDependency objects

dsvg_fonts

named list of family names for dsvg()

sources

named list of source labels

Arguments

sans

font for sans-serif text.

serif

font for serif text.

mono

font for monospace text.

symbol

font for symbol text.

See Also

font_set_liberation(), font_set_auto()

Other font set functions: font_google(), font_liberation(), font_set_auto(), font_set_liberation()

Examples

Run this code
fonts <- font_set(sans = font_liberation("sans"))
fonts$sans
fonts$dsvg_fonts
fonts$dependencies

Run the code above in your browser using DataLab