From 0db4da11e6be442e6585158e8aec31d51804f70a Mon Sep 17 00:00:00 2001 From: ecoisilva Date: Thu, 20 Jun 2024 09:39:29 +0200 Subject: [PATCH] :bug: change dependency --- DESCRIPTION | 2 +- R/mod_tab_about.R | 28 +++++++++++++--------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e827139..4a60673 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -47,7 +47,7 @@ Imports: shinyWidgets, stats, stringr, - sysfonts, + gdtools, terra, tidyr, utils, diff --git a/R/mod_tab_about.R b/R/mod_tab_about.R index d8c8984..5927d9f 100644 --- a/R/mod_tab_about.R +++ b/R/mod_tab_about.R @@ -286,21 +286,19 @@ mod_tab_about_server <- function(id, rv) { # MAIN REACTIVE VALUES ------------------------------------------------ - # observe({ - # - # font_available <- tryCatch({ - # sysfonts::font_add_google(name = "Roboto Condensed", - # family = "Roboto Condensed") - # }, error = function(e) { - # warning("Font failed.") - # }) - # - # rv$is_font <- TRUE - # if (inherits(font_available, "error")) { - # rv$is_font <- FALSE - # } - # - # }) # end of observe + observe({ + + font_available <- tryCatch({ + gdtools::register_gfont(family = "Roboto Condensed") + }) + + if (inherits(font_available, "error")) { + rv$is_font <- FALSE + } else { + rv$is_font <- TRUE + } + + }) # end of observe observe({ rv$which_data <- input$which_data