davidgohel / rvg

https://davidgohel.github.io/rvg/
132 stars 15 forks source link

issue with systemfonts #33

Closed ZhangAngus closed 4 years ago

ZhangAngus commented 4 years ago

Dear Sir, When I was running the example codes provided, it always prompted R encountered a fatal error. The session was teminated. . The error prompted on executing the codes

doc <- ph_with(x = doc, editable_graph,
               location = ph_location_type(type = "body")  )

No matter the CRAN or github edition of rvg and officers packages.

The full codes and session info are showed below.

In addition, when I tested with preview R edition, like 3.6.0, it worked well with no error.

So I suspect that rvg or officer may be incompatible with R 3.6.3.

And, thank you for your efforts on these amazing packages.

Codes

setwd("d:/")
library(ggplot2)
library(officer)
library(rvg)
gg_plot <- ggplot(data = iris ) +
  geom_point(
    mapping = aes(Sepal.Length, Petal.Length, color = Species),
    size = 3) + theme_minimal()

editable_graph <- dml(ggobj = gg_plot)
doc <- read_pptx()
doc <- add_slide(doc)
doc <- ph_with(x = doc, editable_graph,
               location = ph_location_type(type = "body")  )
print(doc, target = "rvg.pptx")

SessionInfo

R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936 
[2] LC_CTYPE=Chinese (Simplified)_China.936   
[3] LC_MONETARY=Chinese (Simplified)_China.936
[4] LC_NUMERIC=C                              
[5] LC_TIME=Chinese (Simplified)_China.936    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4        rstudioapi_0.11   magrittr_1.5     
 [4] usethis_1.5.1     devtools_2.2.2    pkgload_1.0.2    
 [7] R6_2.4.1          rlang_0.4.5       fansi_0.4.1      
[10] tools_3.6.3       pkgbuild_1.0.6    sessioninfo_1.1.1
[13] cli_2.0.2         withr_2.1.2       ellipsis_0.3.0   
[16] fortunes_1.5-4    remotes_2.1.1     assertthat_0.2.1 
[19] digest_0.6.25     rprojroot_1.3-2   crayon_1.3.4     
[22] processx_3.4.2    callr_3.4.2       fs_1.3.2         
[25] ps_1.3.2          testthat_2.3.2    memoise_1.1.0    
[28] glue_1.3.2        compiler_3.6.3    desc_1.2.0       
[31] backports_1.1.5   prettyunits_1.1.1
davidgohel commented 4 years ago

Hello,

Could you run the following code in a new R session and add the result please (I need to know rvg, systemfonts, and other dependencies version information) :

library(officer)
library(rvg)
sessionInfo()

Thank you

ZhangAngus commented 4 years ago

Hello,

Could you run the following code in a new R session and add the result please (I need to know rvg, systemfonts, and other dependencies version information) :

library(officer)
library(rvg)
sessionInfo()

Thank you

Codes

library(officer)
library(rvg)
sessionInfo()

Outputs

> library(officer)
> library(rvg)
> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936 
[2] LC_CTYPE=Chinese (Simplified)_China.936   
[3] LC_MONETARY=Chinese (Simplified)_China.936
[4] LC_NUMERIC=C                              
[5] LC_TIME=Chinese (Simplified)_China.936    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

other attached packages:
[1] rvg_0.2.4     officer_0.3.8

loaded via a namespace (and not attached):
 [1] compiler_3.6.3    R6_2.4.1          magrittr_1.5     
 [4] tools_3.6.3       Rcpp_1.0.4        gdtools_0.2.1    
 [7] uuid_0.1-4        xml2_1.2.5        zip_2.0.4        
[10] rlang_0.4.5       systemfonts_0.1.1 fortunes_1.5-4   
davidgohel commented 4 years ago

Thank you.

Now, could you run the following?

library(systemfonts)
system_fonts()
ZhangAngus commented 4 years ago

Thank you.

Now, could you run the following?

library(systemfonts)
system_fonts()

Opus, when I ran library(systemfonts), it was OK. But when I ran system_fonts(), it collapsed and prompted R encountered a fatal error. The session was teminated.

davidgohel commented 4 years ago

OK, thanks for taking the time to help.

This issue is tracked here: https://github.com/r-lib/systemfonts/issues/20 - the author is working on it.

David

davidgohel commented 4 years ago

(leave the issue open so that if other users meet the same issue, they know it's a known issue)

ZhangAngus commented 4 years ago

OK, thank you for your patience. I do appreciate your help.

davidgohel commented 4 years ago

@ZhangAngus Thomas may have fixed the issue, would you be ok to test it?

ZhangAngus commented 4 years ago

Once you tagged the issue from APPCRASH in systemfonts.dll, I subscribed the issue.

I tried the branch of noisy-win and the latest master branch posted by thomasp85.

Nothing changed. I will post a reply once a new fix works.

For now, I have downgraded my R edition to make your packages available.

davidgohel commented 4 years ago

ok, thanks and sorry for the noise

ZhangAngus commented 4 years ago

@davidgohel In the latest master branch of systemfonts that @thomasp85 submitted 12 hours ago, the officer and rvg work in the latest R version.

Thank you both for your lovely contributions.