Skip to contents

This functions returns the system dependent font for the alias "sans".

Usage

get_fallback_font_df(
  fonts = systemfonts::system_fonts(),
  fallback_alias = "sans"
)

Arguments

fonts

Data frame obtained by systemfonts::system_fonts

fallback_alias

Character, one of c("sans", "serif", "mono", "emoji") defaults to "sans".

Value

Data frame obtained by systemfonts::system_fonts with one row

Details

The aliases are mapped the following way:

  • "" and "sans" return Helvetica on Mac, Arial on Windows, and the default sans-serif font on Linux (DejaVu Sans on Ubuntu)

  • "serif" return Times on Mac, Times New Roman on Windows, and the default serif font on Linux (DejaVu Serif on Ubuntu)

  • "mono" return Courier on Mac, Courier New on Windows, and the default mono font on Linux (DejaVu Mono on Ubuntu)

  • "emoji" return Apple Color Emoji on Mac, Segoe UI Emoji on Windows, and the default emoji font on Linux (Noto Color on Ubuntu)

See https://github.com/r-lib/systemfonts for details

Examples

get_fallback_font_df()
#> # A tibble: 1 × 9
#>   path                    index name  family style weight width italic monospace
#>   <chr>                   <int> <chr> <chr>  <chr> <ord>  <ord> <lgl>  <lgl>    
#> 1 /usr/share/fonts/truet…     0 Deja… DejaV… Book  normal norm… FALSE  FALSE