[R] pair() and X11 fonts error

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sat Jan 15 11:59:02 CET 2005


John Dougherty <jwd at surewest.net> writes:

> On Friday 14 January 2005 23:29, John Dougherty wrote:
> > I am encountering an font error when using either plot() or pairs() for a
> > scatter plot matrice under some circumstances.  For instances pairs(hills)
> > using the "hills" data set in MASS results in the following error:
> >
> > "Error in text.default(x, y, txt, cex = cex, font = font) :
> >         X11 font at size 16 could not be loaded"
> >
> > However pairs(iris) works fine.  Since the iris data set contains
> > considerably more variables than hills, I am at sea regarding the
> > correction.
> >
> Managed to forget to list the OS.  I'm running SuSE 9.2.

This is a fairly well-known result of SuSE installing only unscalable
Adobe fonts and only in one of 100 and 75 dpi resolutions. R expects
that all the possible fonts are there. This is arguably a bug in R,
but the easy way out is to install the missing fonts. In 9.1, I have

XFree86-fonts-75dpi-4.3.99.902-30
XFree86-fonts-100dpi-4.3.99.902-30

but 9.2 seems to have shifted away from XFree and to x.org, so you'd
have

xorg-x11-fonts-100dpi-6.8.1-15.4.i586.rpm 
xorg-x11-fonts-75dpi-6.8.1-15.4.i586.rpm 

And probably only one of them got installed for you.

[As you may have gathered, the issue is that there is only a small
number of sizes of the Adobe fonts (Helvetica, etc.), and they have
been carefully designed to look good. Attempts to rescale them to
other sizes come out absolutely horrid. The pixel sizes of the fonts
are 8,10,11,12,14,17,18,20,24,25,34. If you play around with xfontsel,
you'll see that some of those are available in both 100 and 75 dpi
variants, but others only in one of them. The logic in the X11 driver
is to select the nearest "adobe-sized" font, but it isn't careful
enough about the case where you have only one resolution installed. So
you go in with size 16, the logic tells you to use size 17 because it
looks better, but you really only had sizes 18 and 14...]

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list