tomwenseleers / export

R package for streamlined export of graphs and data tables.
190 stars 36 forks source link

Greek letters and symbols not supported #49

Open fpantin opened 1 year ago

fpantin commented 1 year ago

Hello,

using graph2ppt() the greek letters and symbols are converted to squares (this issue has already been raised here by scs some years ago). For instance, the code

par(mar = c(5, 5, 1, 1))
plot(0, ylab = expression(paste("E (mmol m"^-2, " s"^-1, ")", sep = "")), cex.lab = 1.5)
legend("topleft", expression(paste(sigma, " = ", 1, " ")), cex = 2)
graph2ppt(file = "test.pptx")

produces this plot in R: test_R but this plot when saved as pptx: test_PPT

Moreover, the letters of the y-axis are not properly aligned (the 's' should be slightly more on the left to be aligned with the 'm'). The generated pptx is attached: test.pptx

Thanks for your help.

cvanderaa commented 1 year ago

Hello @fpantin,

Unfortunately, I don't have PPT and when I open your file using LibreOffice Impress, the Greek letter appears correctly... So there must be something with the character encoding by PPT. The "s" is however also shifted on my side... This seems to be an issue at the backend level. export heavily relies on officer when exporting to Office formats. Maybe you could get better feedback there?

fpantin commented 1 year ago

Thanks for your reply. I can't investigate more deeply now, but if the issues are solved later on I will keep you posted!