[R] PostScript/PDF graphics with another font

Paul Murrell p.murrell at auckland.ac.nz
Wed Sep 8 02:30:03 CEST 2010


Hi

On 7/09/2010 9:00 a.m., Peter wrote:
>
> I am using the standard phonetic font "Doulos SIL" in a graph
> (http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=DoulosSILfont)
>
> This is an example:
>
> windowsFonts(IPA="TT Doulos SIL")
> barplot(c(1,2,3,4,5),names=c("\u{0251}","\u{0252}","\u{0253}","\u{0254}","\u{0255}"),family="IPA")

If it does NOT have to be specifically Doulos SIL, some of the standard 
Windows fonts appear to include IPA characters, which means that you 
might just be able to use the PDF device provided by the Cairo package ...

library(Cairo)
CairoPDF()
barplot(c(1,2,3,4,5),
         names=c("\u{0251}","\u{0252}","\u{0253}","\u{0254}","\u{0255}"))
dev.off()

If it DOES have to be specifically Doulos SIL, PDF output is possible, 
but it's a bit more work (see 
http://www.stat.auckland.ac.nz/~paul/R/PDF/pdfEncoding.html).  If you 
want to follow this path, contact me directly and I can email you some 
code and files to show how it's done.

Paul

> However, I am unable to make an eps or pdf file from this graph. I get the
> following error message when trying to save as .eps:
>
> Error: family 'IPA' not included in PostScript device
> In addition: Warning messages:
> 1: font family not found in PostScript font database
> [...]
>
> And this when I try to save as .pdf:
>
> Error: Invalid font type
> In addition: Warning messages:
> 1: font family not found in PostScript font database
> [...]
>
> I have tried various applications of the functions postscript(),
> postscriptFonts(), pdf(), but I only get error messages when I try to tell
> it to make use of the Doulos SIL font. I've searched for answers in Nabble
> and google as well, but haven't found a solution (at least not one I
> understand).
>
> I'm using R 2.11 for Windows.
>
> Thank you

-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
paul at stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/



More information about the R-help mailing list