Open Dieuwbieus opened 4 years ago
Thanks,
Do you have the font installed on your mac? For me the used font is "Helvetica", what is yours?
Could you try to change the font with something you are sure you have on your computer:
https://davidgohel.github.io/rvg/articles/offcran/customizing.html#fonts-1
Thank you for you comment :)
It is still not working. I have the font "Roboto" installed on my mac and used this font in my code. I still get the same output in powerpoint with corrupted texts.
gdtools::font_family_exists("Roboto") [1] TRUE
library(officer) library(ggplot2) library(rvg)
gg <- ggplot(mtcars, aes(x = mpg , y = wt, colour = qsec)) + geom_point() + theme_minimal()
graph_editable <- dml(ggobj = gg, fonts = list(sans = "Roboto"))
doc <- read_pptx() doc <- add_slide(doc) doc <- ph_with(x = doc, graph_editable, location = ph_location_type(type = "body") ) print(doc, target = "rvg.pptx")
thanks
I don't know what is happening for now... What client are you using? PowerPoint for mac?
Yes PowerPoint for mac version 16.30. Before I had an older version and it also did not work with that version.
When I am exporting my ggplots from R to powerpoint, my fonts get corrupted in powerpoint (fonts are filled). Herewith the code that gives the error in powerpoint and a picture of how the ggplot looks in powerpoint.
Session info
Example