Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Newlines in text #32

Closed
csgillespie opened this issue Apr 4, 2020 · 4 comments
Closed

Bug: Newlines in text #32

csgillespie opened this issue Apr 4, 2020 · 4 comments

Comments

@csgillespie
Copy link

If I run

library(ggplot2)
library(extrafont)
library(ragg)
extrafont::loadfonts()
g = ggplot(mtcars) +
    geom_label(x = 0, y = 0,
               label = "This is text\n in Arial Narrow",
               family = "Arial Narrow") +
     xlim(c(-2,2)) + ylim(c(-2, 2)) 
ragg::agg_png("ragg.png")
print(g)
dev.off()

the text in Arial Narrow is missing in the png:
ragg

The code worked OK under Linux/Mac

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

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252 
[2] LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

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

other attached packages:
[1] ragg_0.1.5     extrafont_0.17 ggplot2_3.3.0 

loaded via a namespace (and not attached):
 [1] digest_0.6.25     crayon_1.3.4      withr_2.1.2       grid_3.6.3       
 [5] R6_2.4.1          Rttf2pt1_1.3.8    lifecycle_0.2.0   gtable_0.3.0     
 [9] scales_1.1.0      pillar_1.4.3      rlang_0.4.5       farver_2.0.3     
[13] extrafontdb_1.0   labeling_0.3      Cairo_1.5-11      glue_1.3.2       
[17] munsell_0.5.0     compiler_3.6.3    systemfonts_0.1.1 pkgconfig_2.0.3  
[21] colorspace_1.4-1  tibble_2.1.3     
@thomasp85
Copy link
Member

Does it change if you remove the extrafont calls? They are not needed with ragg...

@csgillespie
Copy link
Author

Removed both extra font calls. Issue is still there

@thomasp85
Copy link
Member

I have confirmed with a colleague who has a windows machine that the issue seems to be the trailing space after the newline. I have no idea why this affects windows though

@thomasp85
Copy link
Member

Wow... this was a weird one... fixed now though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants