[R-SIG-Mac] degree symbol using X11 on OSX

Andy Jacobson Andy.Jacobson at noaa.gov
Tue May 26 21:33:51 CEST 2009


Using the scheme in plotmath, I can no longer get the degree symbol  
for my on-screen plots, using X11 on OS X. I instead see an upper-case  
upsilon (I think).  This is reproducible using "demo(plotmath)".   A  
figure drawn with this faulty symbol produces correct postscript (i.e.  
with a degree symbol) when I use dev.copy to write it to an eps file.

I'm using R version 2.8.1 Patched (2009-01-19 r47650) on an intel Mac,  
fully updated OS X 10.5.7.

Help appreciated,


Addendum:  This question was posed on the R-Help list, and Prof Ripley  
was kind enough to give me his thoughts on the problem.  His suggested  
work-around of X11(type="Xlib") does work.  I am re-posting my  
original question here at his suggestion.  Prof Ripley writes:

> And that's the problem, the fonts used by cairographics on Mac OS X.  
> I don't know about the 'no longer': this (and a few others including  
> infinity) have been faulty for some time.  I think it relates to how  
> 'fontconfig' (for which a binary library ships with R for Mac OS X)  
> interacts with Mac fonts, but there are many more interesting things  
> to do that track down such quirks.
> There are some hints about this on ?X11
>     X11 chooses fonts by matching to a pattern, and it is quite
>     possible that it will choose a font in the wrong encoding or which
>     does not contain glyphs for your language (particularly common in
>     'iso10646-1' fonts).
> This does look very like an incorrect encoding for a symbol font.  
> OTOH, the last display in example(points) seems right, so something  
> subtle is going on.
> One option is to use X11(type="Xlib").  Another is to use quartz(),  
> assuming you are not running R on a remote system.
> This is an Mac-specific question and it is always worth asking such  
> on R-sig-mac.
> I believe the behaviour is still the same in 2.9.0 patched, but it  
> is always worth checking the current release, especially on  
> platforms where components that are otherwise part of the OS ship  
> with R (as no one records in the R docs things fixed/broken by  
> updates to such components -- we probably don't even know half of  
> them).

Andy Jacobson
andy.jacobson at noaa.gov

NOAA Earth System Research Lab
Global Monitoring Division
325 Broadway
Boulder, Colorado 80305


More information about the R-SIG-Mac mailing list