Skip to content

Instantly share code, notes, and snippets.

Created July 23, 2015 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/30c385fbea18e6fddfa0 to your computer and use it in GitHub Desktop.
Save anonymous/30c385fbea18e6fddfa0 to your computer and use it in GitHub Desktop.
#Sys.setenv(R_GSCMD="C:/Program\ Files/gs/gs9.16/bin/gswin64c.exe")
library("extrafont")
# since you already have the font installed on the system, you don't
need the following
#font_import(pattern="BRAILLE1.ttf",
paths="C:/Users/jzs/Downloads/fonts", prompt=FALSE)
# the following enable PDF files to use the installed fonts
loadfonts()
# produce the PDF
pdf("C:/Users/jzs/Dropbox/StatData/output.pdf")
Ozone=airquality$Ozone
par(cex=1.2, cex.lab=1.5, cex.axis=1.5, mar=c(5,5,3,2), family="Braille Normal")
plot(Ozone, main="Test", pch=20)
#boxplot(Ozone, main="Test", family="Braille Normal")
dev.off()
# embed the font
Sys.setenv(R_GSCMD="C:/Program\ Files/gs/gs9.16/bin/gswin64c.exe")
embed_fonts("C:/Users/jzs/Dropbox/StatData/output.pdf")
# code ends here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment