[R] Automatic way to embed fonts into all pdf output?

Pascal Oettli kridox at ymail.com
Mon May 13 09:44:33 CEST 2013


Hello,

I don't know whether it is what you are looking for, but "cairo_pdf" 
seems to embed the fonts automatically, if I am not mistaken.

pdf("russian1.pdf", width=3, height=0.8)
grid.text("\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435 
is 'hello' in Russian (Cyrillic)")
dev.off()

cairo_pdf("russian2.pdf", width=3, height=0.8)
grid.text("\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435 
is 'hello' in Russian (Cyrillic)")
dev.off()


Example taken and adapted from
Paul Murrell and Brian Ripley (2006) Non-standard fonts in PostScript 
and PDF graphics. R News, 6(2):41–47. 
http://cran.r-project.org/doc/Rnews/Rnews_2006-2.pdf


HTH,
Pascal


On 05/11/2013 01:35 AM, Paul Johnson wrote:
> This is a feature request. Or else a howto request.  Can there be some
> simple, automatic way to make fonts embed into pdf output? Could this be in
> options() or par()?
>
> Why?
>
> I recently wanted to create a paper for a conference in a format called
> AAAI (which I had never heard of before because I live in a cave).
>
> http://www.aaai.org/Publications/Author/author.php
>
> In their instructions for LaTeX, it has the statement:
>
> All fonts must be embedded in the PDF file — this includes your figures.
>
> I remember that after one creates a pdf file in R with the pdf device, one
> can then add fonts to it with the embedFonts() function. But I forget!  And
> this is difficult to explain to nonprogramemrs, who just want to put some
> figures in a document.   I wish there were something I could put in
> options() or par() or somewhere to just make this always happen.  I
> understand this will make pdf files larger, but I'm willing to spend the
> disk.
>
>
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list