leonawicz / lcars

LCARS aesthetic for Shiny
https://leonawicz.github.io/lcars/
Other
68 stars 4 forks source link

Showtext sysfonts.so image not loadable #3

Closed mar-wir closed 4 years ago

mar-wir commented 4 years ago

Dear Matt,

Many thanks for such a wonderful package.

I am experiencing a problem when trying to run any of the demos provided in your package. The problem is related with the {sysfonts} package. Any suggestions would be appreciated.

See a reprex below:

devtools::install_github("tidyverse/reprex", force = TRUE)
#> Downloading GitHub repo tidyverse/reprex@master
#> 
#>      checking for file ‘/private/var/folders/t2/69qmq_gx2xz73qvdjp5w19v80000gn/T/Rtmpiz4NgT/remotes83257097576/tidyverse-reprex-d898823/DESCRIPTION’ ...  ✓  checking for file ‘/private/var/folders/t2/69qmq_gx2xz73qvdjp5w19v80000gn/T/Rtmpiz4NgT/remotes83257097576/tidyverse-reprex-d898823/DESCRIPTION’
#>   ─  preparing ‘reprex’:
#>      checking DESCRIPTION meta-information ...  ✓  checking DESCRIPTION meta-information
#>   ─  checking for LF line-endings in source and make files and shell scripts
#>   ─  checking for empty or unneeded directories
#>   ─  building ‘reprex_0.3.0.9001.tar.gz’
#>      
#> 

library(lcars)
library(trekcolors)
library(ggplot2)
library(grid)
library(png)

lcarsApp("demo")
#> This app requires the `showtext` package. Install and rerun.

library(showtext)
#> Loading required package: sysfonts
#> Error: package or namespace load failed for 'sysfonts':
#>  .onLoad failed in loadNamespace() for 'sysfonts', details:
#>   call: dyn.load(file, DLLpath = DLLpath, ...)
#>   error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sysfonts/libs/sysfonts.so':
#>   dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sysfonts/libs/sysfonts.so, 6): Library not loaded: /opt/X11/lib/libfreetype.6.dylib
#>   Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/sysfonts/libs/sysfonts.so
#>   Reason: image not found
#> Error: package 'sysfonts' could not be loaded

install.packages("sysfonts")
#> 
#> The downloaded binary packages are in
#>  /var/folders/t2/69qmq_gx2xz73qvdjp5w19v80000gn/T//Rtmpiz4NgT/downloaded_packages

library(showtext)
#> Loading required package: sysfonts
#> Error: package or namespace load failed for 'sysfonts':
#>  .onLoad failed in loadNamespace() for 'sysfonts', details:
#>   call: dyn.load(file, DLLpath = DLLpath, ...)
#>   error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sysfonts/libs/sysfonts.so':
#>   dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sysfonts/libs/sysfonts.so, 6): Library not loaded: /opt/X11/lib/libfreetype.6.dylib
#>   Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/sysfonts/libs/sysfonts.so
#>   Reason: image not found
#> Error: package 'sysfonts' could not be loaded

lcarsApp("demo")
#> This app requires the `showtext` package. Install and rerun.

sessionInfo()
#> R version 3.6.2 (2019-12-12)
#> Platform: x86_64-apple-darwin15.6.0 (64-bit)
#> Running under: macOS Catalina 10.15.3
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] grid      stats     graphics  grDevices utils     datasets  methods  
#> [8] base     
#> 
#> other attached packages:
#> [1] png_0.1-7        ggplot2_3.2.1    trekcolors_0.1.1 lcars_0.3.5     
#> 
#> loaded via a namespace (and not attached):
#>  [1] ggrepel_0.8.2     Rcpp_1.0.3        prettyunits_1.1.1 ps_1.3.3         
#>  [5] assertthat_0.2.1  rprojroot_1.3-2   digest_0.6.25     mime_0.9         
#>  [9] R6_2.4.1          backports_1.1.5   reprex_0.3.0.9001 evaluate_0.14    
#> [13] highr_0.8         pillar_1.4.3      rlang_0.4.7       lazyeval_0.2.2   
#> [17] curl_4.3          callr_3.4.3       rmarkdown_2.3     desc_1.2.0       
#> [21] devtools_2.2.1    stringr_1.4.0     munsell_0.5.0     shiny_1.4.0      
#> [25] compiler_3.6.2    httpuv_1.5.2      xfun_0.15         pkgconfig_2.0.3  
#> [29] pkgbuild_1.0.6    htmltools_0.5.0   tidyselect_1.0.0  tibble_2.1.3     
#> [33] fansi_0.4.1       crayon_1.3.4      dplyr_0.8.4       withr_2.2.0      
#> [37] later_1.0.0       xtable_1.8-4      gtable_0.3.0      lifecycle_0.1.0  
#> [41] magrittr_1.5      scales_1.1.0      cli_2.0.2         stringi_1.4.6    
#> [45] fs_1.4.2          promises_1.1.0    remotes_2.1.0     testthat_2.3.1   
#> [49] ellipsis_0.3.0    tools_3.6.2       glue_1.4.1        purrr_0.3.3      
#> [53] processx_3.4.3    pkgload_1.0.2     fastmap_1.0.1     yaml_2.2.1       
#> [57] colorspace_1.4-1  sessioninfo_1.1.1 memoise_1.1.0     knitr_1.29       
#> [61] usethis_1.5.1

Created on 2020-07-10 by the reprex package (v0.3.0.9001)

leonawicz commented 4 years ago

HI Marco,

I'm glad you like the package. I appreciate the reprex, though it looks like this doesn't relate to lcars. A minimal reprex looks like it would just be a sysfonts/Mac OS issue. Maybe just need XQuartz? I don't have a Mac to confirm. https://github.com/yixuan/showtext/issues/13

mar-wir commented 4 years ago

Many thanks for the tip! XQuartz might solve it! I will let you know if it worked.