I wanted to put a short example into the r-help archives how to embed
the Bera (texlive) font.

options(texlive= "/usr/local/texlive/2012/")
options(texfonts= paste0(getOption("texlive"), "/texmf-dist/fonts/"))
library(grDevices)
pdfFonts(Bera = Type1Font("Bera", paste0(getOption("texfonts"),
"afm/public/bera/", c("fvsr8a","fvsb8a","fvsro8a","fvsbo8a"),
".afm")))
options(pfbdir = c(paste0(getOption("texfonts"), "type1/public/bera/")))

and now

pdf(file="test.pdf", family="Bera")
plot(1:10, 1:10)
dev.off()
embedFonts( file= "test.pdf", fontpaths = getOption("pfbdir") )

it would be more elegant if pdf() could take fontpaths that the
subsequent embedFonts needs and the dev.off would execute embedFonts
automatically on dev.off; and/or if pdfFonts could take an optional
.pfbdir that embedFonts would search.  but this is pretty painless
already as is, esp to how it was 5 years ago.  thanks to all the folks
that put in the hard work to make this possible.

[PS: The above may be incorrect in terms of encoding, dingbats
(symbols), or other issues.  I just checked that the basics worked.]

regards,

/iaw
----
Ivo Welch (ivo.we...@gmail.com)

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to