[R-sig-Debian] Sweave(), pdf(), and fonts

Jeffrey Horner jeff.horner at vanderbilt.edu
Wed Aug 22 18:42:20 CEST 2007


Hi all,

We have a user that would like to create pdf plots using the Arial font. 
One way for her to do this is to use the Cairo graphics device which 
produces pdf's beautifully and embeds fonts automatically. She could 
also install the msttcorefonts package from ubuntu to obtain the Arial font.

The problem is that she is using Sweave() to produce a document that 
contains the pdf plots, and Sweave() calls pdf() rather than Cairo() to 
generate the pdfs, so my questions to the list are:

1) Does anyone know if Sweave() has a way to "swap out" the call to 
pdf() with another device, say Cairo()? I think this would be the 
easiest way to solve her problem.

2) Does anyone know how to do this with pdf()? I suspect that the font 
databases can be updated via the commands pdfFonts() or 
postscriptFonts(), but are there suitable debian font packages that 
contain font information that can be supplied to these functions? Are 
any font packages needed at all?

The pdf plots don't necessarily need to embed the fonts, but they need 
enough info in them to say "Use the Arial font" to the pdf reader or 
printer. Then it's up to the reader or the printer to find the Arial 
font if it's installed or a suitable replacement if it's not.

You'll have to forgive my ignorance about font usage in R with 
UNIX/Linux; it's just so darn confusing, and I'm saying that will at 
least 10 years of UNIX/Linux experience under my belt.

Thanks,

Jeff
-- 
http://biostat.mc.vanderbilt.edu/JeffreyHorner



More information about the R-SIG-Debian mailing list