ggplot: Export ggsave files to emf using ragg fonts

86 Views Asked by At

I'm struggling to combine the use of the ragg font package with ggsave to an 'emf' file. If I try to use something like this below having installed the 'Myriad Pro' font (https://fontsgeek.com/myriad-pro-font?ref=readme) using the ragg package:

ggplot(mtcars, aes(x = mpg, y = wt)) + 
  geom_point() + 
  theme(text = element_text(family = "Myriad Pro")) -> plt

ggsave(plt, filename = "test1.emf")

When I then insert the resulting emf file into a word document and then save it as a PDF, the text pixels:

enter image description here

But when I use exactly this procedure using the default font, then this does not happen:

ggplot(mtcars, aes(x = mpg, y = wt)) + 
  geom_point()  -> plt

ggsave(plt, filename = "test2.emf")

enter image description here

Any idea on how to solve this? I looked in ragg for the right device to use but I am none the wiser I'm afraid.

Many thanks!

0

There are 0 best solutions below