Learn R Programming

gdtools (version 0.6.0)

font_family_exists: Check if font family exists.

Description

Check if a font family exists in available fonts.

Usage

font_family_exists(font_family = "sans", system_only = FALSE)

Value

A logical value

Arguments

font_family

font family name (case sensitive)

system_only

If TRUE, only look in system-installed fonts (as returned by systemfonts::system_fonts()). This is useful to verify that a font will be found by fontconfig, which is the font resolution mechanism used by cairo_pdf() at rendering time. When FALSE (the default), both system and registered fonts are considered.

Examples

Run this code
font_family_exists("sans")
font_family_exists("Arial")
font_family_exists("Courier")
font_family_exists("Arial", system_only = TRUE)

Run the code above in your browser using DataLab