match_family {gdtools} | R Documentation |
match_family()
returns the best font family match for the
fontconfig pattern constructed from the bold
and
italic
arguments. The default pattern is bold italic to make
sure the matched font has enough features to be used in R graphics
(plain, bold, italic, bold italic). match_font()
returns the
font file from the best family match, along with some metada in the
attributes.
match_family(font = "sans", bold = TRUE, italic = TRUE, debug = NULL) match_font(font = "sans", bold = FALSE, italic = FALSE, debug = NULL)
font |
family or face to match. |
bold |
Wheter to match a font featuring a |
italic |
Wheter to match a font featuring an |
debug |
Flag for debugging FontConfig. Can be one of
|
Fontconfig matching is controlled via the fonts.conf
file. Use debug = "config"
to make sure what configuration
file it is currently using (there can be several installations on
one system, especially on Macs). See
https://www.freedesktop.org/software/fontconfig/fontconfig-user.html
for more information about debugging flags.
## Not run: # The first run can be slow when font caches are missing # as font files are then being scanned to build those font caches. match_family("sans") match_family("serif", bold = FALSE, italic = TRUE) match_font("Helvetica", bold = FALSE, italic = TRUE) match_font("Helvetica", debug = "config") ## End(Not run)