# NOT RUN {
font_add_google("Alegreya Sans", "aleg")
if(require(showtext))
{
wd = setwd(tempdir())
pdf("google-fonts-ex.pdf")
showtext_begin()
par(family = "aleg")
plot(0:5,0:5, type="n")
text(1:4, 1:4, "Alegreya Sans", font=1:4, cex = 2)
showtext_end()
dev.off()
setwd(wd)
}
# }
Run the code above in your browser using DataLab