mono fonts (was RE: [Rd] RE: [R] SAS or R software)

Paul Murrell p.murrell at auckland.ac.nz
Mon Dec 20 23:54:49 CET 2004


Hi


Warnes, Gregory R wrote:
> Ah, I'm using Exceed Hummingbird 7.1 as the X server....  
> 
> It does have fixed width fonts, and it is happy with variable width fonts up
> to this extreme ....
> 
> A little more fiddling shows that this succeds with a linux based X11
> server, and that even 
> 	plot(1,1)
> 	par(family="mono",cex=8)
> 	text(1,1,"foo") 
> segfaults.
> 
> 
> I've tested values of cex.  Anything above 2.1249 seems to segfault.  


The X11 device works pretty hard to find a font to use and if it really 
can't find anything it should throw an error, not segfault.  Are you 
able to debug this and see where it is failing?

(I'm using Xwin32 and for large font size requests that can't be 
satisfied I get the intended behaviour which is warnings that a smaller 
font is being substituted)

Paul


>>-----Original Message-----
>>From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk]
>>Sent: Monday, December 20, 2004 4:39 PM
>>To: Warnes, Gregory R
>>Cc: Paul Murrell; R-Devel
>>Subject: mono fonts (was RE: [Rd] RE: [R] SAS or R software)
>>
>>
>>[Please update the subject line, folks!]
>>
>>We need to know the device in use here ... and only a few 
>>support this 
>>mechanism.
>>
>>If it is X11(), I suspect the problem is in what fonts are available, 
>>since cex=8 is pretty extreme.  So most likely you need to 
>>contribute a 
>>patch based on debugging on your system.
>>
>>BTW, for those who missed this, see Paul's article in the Sept 2004 
>>R-News.
>>
>>BTW^2 some devices have supported fixed-width fonts for many years.
>>
>>
>>On Mon, 20 Dec 2004, Warnes, Gregory R wrote:
>>
>>
>>>Yes, par(family="mono") would work, except that I get R 
>>
>>segfaults from this
>>
>>>sequence:
>>>
>>>
>>>>plot.new()
>>>>par(family="mono")
>>>>par(cex=8)
>>>>strheight("foo")
>>>
>>>Process R segmentation fault (core dumped) at Mon Dec 20 
>>
>>16:07:56 2004
>>
>>>on R 2.0.1 (2004-11-15), Red Hat Enterprise Linux AS release 3
>>>
>>>In my code I call strheight and strwidth several times in 
>>
>>order to find a
>>
>>>cex that makes the text best fit the display area.  Once 
>>
>>the segfaulting is
>>
>>>fixed, I'll update my code to use par(family="mono").
>>>
>>>-G
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: Marc Schwartz [mailto:MSchwartz at MedAnalytics.com]
>>>>Sent: Monday, December 20, 2004 3:57 PM
>>>>To: Paul Murrell
>>>>Cc: Warnes, Gregory R; R-Devel; Frank E Harrell Jr
>>>>Subject: Re: [Rd] RE: [R] SAS or R software
>>>>
>>>>
>>>>On Tue, 2004-12-21 at 08:40 +1300, Paul Murrell wrote:
>>>>
>>>>>Hi
>>>>>
>>>>>
>>>>>Warnes, Gregory R wrote:
>>>>>
>>>>>>>-----Original Message-----
>>>>>>>From: Frank E Harrell Jr [mailto:f.harrell at vanderbilt.edu]
>>>>>>
>>>>>>...
>>>>>>
>>>>>>
>>>>>>>This is neat Greg.  Just installed the latest gregmisc.  Do you
>>>>>>>automatically used fixed width fonts for this, for alignment
>>>>>>>of columns?
>>>>>>
>>>>>>
>>>>>>Unfortunately, I haven't found any way to select
>>>>>
>>>>fixed-width fonts, so I
>>>>
>>>>>>convert the character vector into a matrix of individual
>>>>>
>>>>characters so that
>>>>
>>>>>>they align properly.  Its pretty horrid.
>>>>>>
>>>>>>I hope that the R developers will provide a way of
>>>>>
>>>>selecting a fixed width
>>>>
>>>>>>font in the future so I can remove this ugly hack.
>>>>>
>>>>>
>>>>>Does par(family="mono") do what you want?
>>>>>
>>>>>Paul
>>>>
>>>>
>>>>It works here using R 2.0.1 under FC3. I tried it to the 
>>>
>>display and
>>
>>>>with pdf() using sinkplot().
>>>>
>>>>With postscript() one can use the 'family = "Courier'
>>>>argument as well.
>>>>Seems to work here.
>>>>
>>>>According to ONEWS, par("family") is new for 2.0.0.  
>>>
>>Missed that one.
>>
>>>>Thanks Paul.
>>>>
>>>>Marc
>>>>
>>>>
>>>>
>>>
>>>
>>>LEGAL NOTICE\ Unless expressly stated otherwise, this 
>>
>>messag...{{dropped}}
>>
>>>______________________________________________
>>>R-devel at stat.math.ethz.ch mailing list
>>>https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>>
>>
>>-- 
>>Brian D. Ripley,                  ripley at 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 272866 (PA)
>>Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>>
> 
> 
> 
> LEGAL NOTICE
> Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.


-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
paul at stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/



More information about the R-devel mailing list