Closed yixuan closed 2 years ago
The current code
font_file <- function(variant) { dir( cache_dir, full.names = TRUE, pattern = paste0(variant, "\\.ttf$") ) }
will match both italic.ttf and bolditalic.ttf if variant is "italic", thus passing a length-two vector to systemfonts::register_font() or sysfonts::font_add(). The fix is also simple:
italic.ttf
bolditalic.ttf
variant
"italic"
systemfonts::register_font()
sysfonts::font_add()
font_file <- function(variant) { dir( cache_dir, full.names = TRUE, pattern = paste0("^", variant, "\\.ttf$") ) }
Oh yes, this is likely what causes the follwing warning I get when using thematic_shiny(font = "auto")
thematic_shiny(font = "auto")
Warning in check_font_path(italic, "italic") : 'italic' should be a length-one vector, using the first element
The current code
will match both
italic.ttf
andbolditalic.ttf
ifvariant
is"italic"
, thus passing a length-two vector tosystemfonts::register_font()
orsysfonts::font_add()
. The fix is also simple: