Dear R-users,

When one defines a grid unit object using the 'strwidth' dimension, it
seems that the default plain font is assumed as the following example
illustrates. Is there a way to either make use of a font option when
creating a unit object or to know the factor that exists between the
width of the same text printed in plain and in bold? This might be
dependent on the font, though...

require(grid)

grid.rect(width=unit(1,'strwidth','Some text'),draw=T)

grid.text('Some text',draw=T)                                   # fits
nicely in the box
grid.text('Some text',y=0.4,gp=gpar(font=2),draw=T)  # partially outside the box

Thank you in advance for your input on this issue.

Sebastien

______________________________________________
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.

Reply via email to