[R-lang] Re: Including IPA fonts in plots?

Michael Becker michael.becker@phonologist.org
Tue Oct 5 16:30:49 PDT 2010


Hi Roger,

Specifying the name of a Unicode font will do the trick, e.g.:

par(family="Linux Libertine"); plot(1:2,1:2);text(1.5,1.5,"ʌ")
or
par(family="Doulos SIL");plot(1:2,1:2);text(1.5,1.5,"ʌ")

You'll need to have the relevant font installed, of course.

I hope this helps,
Michael



On Tue, Oct 5, 2010 at 6:58 PM, Levy, Roger <rlevy@ucsd.edu> wrote:
> Hi all,
>
> Has anyone had unqualified success in rendering IPA symbols in R?  graphs I've had trouble; within the R.app GUI on OS X, the commands
>
>> plot(1:2,1:2)
>> text(1.5,1.5,"ʌ") # in case it's not rendered properly in your email client, the character is the wedge in UTF-8
>
> give just a box, and I get even worse failure if I try to create a Postscript or PDF file:
>
>> postscript("test.ps") # same error ensues if I use pdf("test.pdf") here instead
>> plot(1:2,1:2)
>> text(1.5,1.5,"ʌ")
> Warning messages:
> 1: In text.default(1.5, 1.5, "ʌ") :
>  conversion failure on 'ʌ' in 'mbcsToSbcs': dot substituted for <ca>
> 2: In text.default(1.5, 1.5, "ʌ") :
>  conversion failure on 'ʌ' in 'mbcsToSbcs': dot substituted for <8c>
> 3: In text.default(1.5, 1.5, "ʌ") :
>  font metrics unknown for Unicode character U+028c
> 4: In text.default(1.5, 1.5, "ʌ") :
>  conversion failure on 'ʌ' in 'mbcsToSbcs': dot substituted for <ca>
> 5: In text.default(1.5, 1.5, "ʌ") :
>  conversion failure on 'ʌ' in 'mbcsToSbcs': dot substituted for <8c>
>
> Interesting, ash (æ) renders fine on all graphics devices
>
> Any suggestions would be very welcome!
>
> (Stefan Evert suggested a while back that IPA fonts should just work within the R.app GUI for OS X, but I haven't found this to be the case.)
>
> Best & many thanks in advance,
>
> Roger
>
> --
>
> Roger Levy                      Email: rlevy@ling.ucsd.edu
> Assistant Professor             Phone: 858-534-7219
> Department of Linguistics       Fax:   858-534-4789
> UC San Diego                    Web:   http://ling.ucsd.edu/~rlevy
>
>
>
>
>
>
>
>
>



-- 
Michael Becker
Department of Linguistics
Harvard University
http://becker.phonologist.org/



More information about the ling-r-lang-L mailing list