Skip to contents

Initialize or remove font directory used to store downloaded font files.

This directory is managed by R function R_user_dir() but can also be defined in a non-user location by setting ENV variable GDTOOLS_CACHE_DIR or by setting R option GDTOOLS_CACHE_DIR.

Its value can be read with the fonts_cache_dir() function.

The directory can be deleted with rm_fonts_cache() and created with init_fonts_cache().

Usage

fonts_cache_dir()

rm_fonts_cache()

init_fonts_cache()

Examples

fonts_cache_dir()
#> [1] "/home/runner/.local/share/R/gdtools"

options(GDTOOLS_CACHE_DIR = tempdir())
fonts_cache_dir()
#> [1] "/tmp/RtmplszkrY"
options(GDTOOLS_CACHE_DIR = NULL)

Sys.setenv(GDTOOLS_CACHE_DIR=tempdir())
fonts_cache_dir()
#> [1] "/tmp/RtmplszkrY"
Sys.setenv(GDTOOLS_CACHE_DIR="")



init_fonts_cache()
#> [1] "/home/runner/.local/share/R/gdtools"
dir.exists(fonts_cache_dir())
#> [1] TRUE

rm_fonts_cache()
dir.exists(fonts_cache_dir())
#> [1] FALSE