rstudio / thematic

Theme ggplot2, lattice, and base graphics based on a few simple settings.
https://rstudio.github.io/thematic/
Other
244 stars 10 forks source link

Catch and rethrow font support warnings #69

Open cpsievert opened 3 years ago

cpsievert commented 3 years ago

Base/grid throw many redundant warning(s) when a family isn't supported --- it'd be nice to catch them and use maybe_warn() to only throw them once.

> library(shiny)
> thematic::thematic_on("black", "white", font = "auto")
> ui <- fluidPage(
+   plotOutput("p")
+ )
> server <- function(input, output, session) {
+   output$p <- renderPlot(hist(1:10))
+ }
> shinyApp(ui, server)

Listening on http://127.0.0.1:3988
Warning in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) :
  font family 'Helvetica Neue' not found, will use 'sans' instead
Warning in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) :
  font family 'Helvetica Neue' not found, will use 'sans' instead
Warning in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) :
  font family 'Helvetica Neue' not found, will use 'sans' instead
Warning in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) :