check_fonts_in_r: Test if fonts are available on the system and import them in...

View source: R/fonts.R

check_fonts_in_rR Documentation

Test if fonts are available on the system and import them in R

Description

Test if fonts are available on the system and import them in R

Usage

check_fonts_in_r(
  fonts = c("Marianne", "Spectral"),
  import = TRUE,
  verbose = TRUE
)

Arguments

fonts

Vector of fonts.

import

Logical. Whether to import ttf font files in R (otherwise just check).

verbose

List fonts to install if needed.

Details

For fonts to be used, they need to be installed on the machine.

Examples

## Not run: 
check_fonts_in_r(import = FALSE)

# Test if working
library(ggplot2)
ggplot(mtcars) + geom_point(aes(cyl, mpg)) + labs(title = "Mon titre avec Marianne",
    x = "lab X avec Spectral", y = "Lab Y avec Spectral") +
    theme(title = element_text(family = "Marianne"),
        axis.title.x = element_text(family = "Spectral"),
        axis.title.y = element_text(family = "Spectral"))

## End(Not run)

spyrales/gouvdown documentation built on Dec. 3, 2023, 3:25 a.m.