R/fonts.R
check_fonts_in_r.Rd
Test if fonts are available on the system and import them in R
check_fonts_in_r(
fonts = c("Marianne", "Spectral"),
import = TRUE,
verbose = TRUE
)
Vector of fonts.
Logical. Whether to import ttf
font files in R (otherwise
just check).
List fonts to install if needed.
For fonts to be used, they need to be installed on the machine.
if (FALSE) {
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"))
}