On my system, ragg is installed but showtext is not.
Example with base graphics. It renders the plot, but with no visible text.:
library(thematic)
thematic_on(font = "Righteous")
plot(1:5)
#> There were 40 warnings (use warnings() to see them)
warnings()
#> Warning messages:
#> 1: thematic was unable to resolve `bg='auto'`. Try providing an actual color (or `NA`) to the `bg` argument of `thematic_on()`. By the way, 'auto' is only officially supported in `shiny::renderPlot()`, some rmarkdown scenarios (specifically, `html_document()` with `theme!=NULL`), in RStudio, or if `auto_config_set()` is used.
#> 2: thematic was unable to resolve `fg='auto'`. Try providing an actual color (or `NA`) to the `fg` argument of `thematic_on()`. By the way, 'auto' is only officially supported in `shiny::renderPlot()`, some rmarkdown scenarios (specifically, `html_document()` with `theme!=NULL`), in RStudio, or if `auto_config_set()` is used.
#> 3: thematic was unable to resolve `accent='auto'`. Try providing an actual color (or `NA`) to the `accent` argument of `thematic_on()`. By the way, 'auto' is only officially supported in `shiny::renderPlot()`, some rmarkdown scenarios (specifically, `html_document()` with `theme!=NULL`), in RStudio, or if `auto_config_set()` is used.
#> 4: In axis(side = side, at = at, labels = labels, ...) :
#> no font could be found for family "Righteous"
#> 5: In axis(side = side, at = at, labels = labels, ...) :
#> no font could be found for family "Righteous"
...
#> no font could be found for family "Righteous"
#> 36: In axis(side = side, at = at, labels = labels, ...) :
#> no font could be found for family "Righteous"
#> 37: In title(...) : no font could be found for family "Righteous"
#> 38: In title(...) : no font could be found for family "Righteous"
#> 39: In title(...) : no font could be found for family "Righteous"
#> 40: In title(...) : no font could be found for family "Righteous"
With ggplot2. It does NOT render the plot at all:
library(ggplot2)
library(thematic)
thematic_on(font = "Righteous")
ggplot() + labs(title = "Custom hello title")
#> Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
#> polygon edge not found
#> In addition: There were 18 warnings (use warnings() to see them)
I think these things need to be different:
thematic should give useful warnings. Need to be careful about what to say about when to install or use a package. For example, if showtext is installed, it will be used automatically; on the other hand, if ragg is installed but not the active device, it will not be used automatically. The message should reflect that.
If these fonts aren't available, it should render the plots with normal fonts.
On my system, ragg is installed but showtext is not.
Example with base graphics. It renders the plot, but with no visible text.:
With ggplot2. It does NOT render the plot at all:
I think these things need to be different: