extrafont
extrafont copied to clipboard
Font is embeded, but i can not document properly
Hi.. When I run the below the code, and open pdf file, the font is not embeded. Please advise
Sys.setenv(R_GSCMD = "C:/GhostScript/gs10.01.1/bin/gswin64c.exe")
library(extrafont)
extrafont::font_import()
Register the fonts with R
loadfonts(device = "all")
library(ggplot2)
ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point() + ggtitle("Title text goes here") + theme(text = element_text(size = 16, family = "Impact"))
ggsave("myplot.pdf", width = 4, height = 4)
embed_fonts("myplot.pdf")
however when i used ggsave("myplot.pdf", width = 4, height = 4, device = cairo_pdf)
it works perfectly