[Rd] text() with large cex parameter crashes X11() (PR#553)

Prof Brian Ripley Prof Brian Ripley <ripley@stats.ox.ac.uk>
Tue, 23 May 2000 12:21:15 +0100 (BST)

> X-Priority: 3 (Normal)
> Date: Tue, 23 May 2000 11:12:11 +0200 (CEST)
> From: Martyn Plummer <plummer@iarc.fr>
> To: Ben Bolker <ben@zoo.ufl.edu>, Uwe Ligges 
<ligges@statistik.uni-dortmund.de>, Martin Maechler 
<maechler@stat.math.ethz.ch>, Prof Brian Ripley <ripley@stats.ox.ac.uk>
> Subject: Re: [Rd] text() with large cex parameter crashes X11() (PR#553)
> Cc: R-bugs@biostat.ku.dk, r-devel@stat.math.ethz.ch
> Well, I wasn't wrong. Here's R with DEBUG_X11 switched on
> > plot(1,1,type="n")
> loading:
> -*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*
> success
> > points(1,1,pch="A", cex=10)
> loading:
> -*-helvetica-medium-r-*-*-120-*-*-*-*-*-*-*
> failure
> loading:
> -*-helvetica-medium-r-*-*-34-*-*-*-*-*-*-*
> failure
> Program received signal SIGSEGV, Segmentation fault.
> 0x8126336 in SetFont (face=1, size=120, dd=0x8251168) at devX11.c:940
> 940             XSetFont(display, xd->wgc, xd->font->fid);
> (gdb) p xd->font
> $1 = (XFontStruct *) 0x0
> RLoadFont ignores the fact that it has failed to load a font
> and returns a null pointer. 

I think it is SetFont that ignores the null pointer.

> If this works for you it is perhaps because you have the size 34 font
> (the last resort) on your system.

I at least have Helvetica in type 1 and so do have 120pt Helevetica
(and have used such a system all the time I have been using X11).

> R-devel gives the same result.

What should we do in this circumstance?  Drop back to fixed?  Try a
smaller size?   What sizes do you have?   A quick look around on an R6.0
system suggests that it has 8,10,12,14,18,24, which is what Solaris
has as bitmaps too.  And at this point basefontsize must have succeeded.
So should we:

try 34 then 24 then basefontsize.

Should we issue a warning if the displayed fontsize differs by more than
10%, say, from that requested?

Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch