Skip to content

Instantly share code, notes, and snippets.

Created July 23, 2015 20:22
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/26a6b1ec7ac9e6808f11 to your computer and use it in GitHub Desktop.
Save anonymous/26a6b1ec7ac9e6808f11 to your computer and use it in GitHub Desktop.
# code starts here
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/tklee/Downloads/fonts", prompt=FALSE)
# the following enable PDF files to use the installed fonts
loadfonts()
# produce the PDF
pdf("C:/Users/tklee/Documents/Histogram_Ozone.pdf")
Ozone=airquality$Ozone
hist(Ozone, 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/tklee/Documents/Histogram_Ozone.pdf")
 
# code ends here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment