Hi! Is there a way to get the string width of the bold typefaces? like: strwidth("text", family = "serif", font = 2). Thanks Roland
Perhaps: strwidth(expression(bold("text"))) On 30/10/2007, Roland Kaiser <roland.kaiser@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@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. >-- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
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/
> Hi > > > Henrique Dallazuanna wrote: >> Perhaps: >> strwidth(expression(bold("text"))) > > > Or set the default font face ...Thanks! Things can often be so easy! Roland> > 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/