Skip to content
Prev 23226 / 63424 Next

Phonetic symbols (IPA) in R graphics

Hi Paul,
I tried the following from your slides, perhaps you can see the
error:

1) I downloaded the fonts and the encoding file into the directories
   Type1 and encodings (in my current directory)
2) I ran R from the same directory (ver 2.4.0)
3) I added the font mapping for the pdf and postscript devices:

ipa <- Type1Font("InternationalPhoneticAlphabet",
                 c("Type1/tipa10.afm",
                   "Type1/tipabx10.afm",
                   "Type1/tipasi10.afm",
                   "Type1/tipabx10.afm"),
                 "encodings/silipa.enc")
pdfFonts(ipa=ipa)
postscriptFonts(ipa=ipa)

4) I created a simple figure:

plot(10,10,type="n")
text(10,10,"whatever",family="InternationalPhoneticAlphabet")

Here I get 13 warnings of the type:
"font family not found in X11 font database"
As far as I understand this is because I defined the fonts only for
the postscript and pdf devices.

5) I copy the device to postscript:

dev.copy2eps(file="whatever.eps")

Here I get the real problem:
Error in dev.copy(file = "whatever.eps", device = function (file =
ifelse(onefile,  :
        invalid character sent to 'PostScriptCIDMetricInfo' in a
single-byte locale

I googled for PostScriptCIDMetricInfo but only found a few pages in
Japanese, can you help me?

Thanks,
Giampiero

I can put the font and encoding files somewhere if necessary.
I am working on a RedHat linux computer with locale:
LANG=en_US.iso88591
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C
On Thu, 14 Dec 2006, Paul Murrell wrote: