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

Jeffrey Horner jeff.horner at vanderbilt.edu
Wed Aug 22 21:31:38 CEST 2007


Vincent Goulet wrote:
> Le 22 août à 12:42, Jeffrey Horner a écrit :
> 
>> 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.
> 
> You don't need to use the default Sweave devices to do the plots. See 
> Sweave's FAQ A.9:
> 
> http://www.ci.tuwien.ac.at/~leisch/Sweave/FAQ.html#x1-11000A.9

You know, I read right past that FAQ question/answer and it didn't even 
dawn on me as a solution.

But of course this begs the question of how effective are <<fig=TRUE>> 
sections in Sweave anyway...

Thanks,

Jeff
> 
> HTH   Vincent
> 
>>
>> 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
>>
>> _______________________________________________
>> R-SIG-Debian mailing list
>> R-SIG-Debian at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-debian
> 


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



More information about the R-SIG-Debian mailing list