[R] strwidth of bold font

Paul Murrell paul at stat.auckland.ac.nz
Wed Oct 31 09:34:17 CET 2007


Hi


Henrique Dallazuanna wrote:
> Perhaps:
> 
> strwidth(expression(bold("text")))


Or set the default font face ...

plot(1:10)
text(4, 6, "testing", adj=c(0, 0))
segments(4, 6, 4 + strwidth("testing"), 6, col="red")
par(font=2)
text(4, 8, "testing", adj=c(0, 0))
segments(4, 8, 4 + strwidth("testing"), 8, col="red")

Paul


> On 30/10/2007, Roland Kaiser <roland.kaiser at sbg.ac.at> wrote:
>> Hi!
>>
>> Is there a way to get the string width of the bold typefaces?
>>
>> like: strwidth("text", family = "serif", font = 2).
>>
>> Thanks
>>
>> Roland
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


-- 
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-help mailing list