jbkunst / highcharter

R wrapper for highcharts
http://jkunst.com/highcharter/
Other
720 stars 148 forks source link

options(highcharter.google_fonts = FALSE) still calls google fonts #700

Closed zac-garland closed 2 years ago

zac-garland commented 3 years ago

The fix for google fonts https://github.com/jbkunst/highcharter/pull/537#issue-293722809 still seems to call google for the font. Is this intended? If so, why?

library(highcharter)

options(highcharter.google_fonts = FALSE)

hc <- highcharts_demo()

thm <- hc_theme(
  chart = list(
    backgroundColor = "#323232",
    fontFamily = "My local font"
  )
)

getOption("highcharter.google_fonts")

hc_add_theme(hc, thm)

highchart() %>%
  hc_add_series(data = abs(rnorm(5)), type = "column") %>%
  hc_add_series(data = purrr::map(0:4, function(x) list(x, x)), type = "scatter", color = "orange") %>% 
  hc_add_theme(thm)

I can't upload a picture, but if you open up the console in the rmarkdown viewer, you should see two calls to https://fonts.googleapis.com/css?family=My+local+font

Which causes an issue when utilizing in a build.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Feel free to reopen it if you find it necessary.