EVOLUTION-MANAGER
Edit File: string_widths_dev.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Get string widths as measured by the current device</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for string_widths_dev {systemfonts}"><tr><td>string_widths_dev {systemfonts}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Get string widths as measured by the current device</h2> <h3>Description</h3> <p>For certain composition tasks it is beneficial to get the width of a string as interpreted by the device that is going to plot it. grid provides this through construction of a <code>textGrob</code> and then converting the corresponding grob width to e.g. cm, but this comes with a huge overhead. <code>string_widths_dev()</code> provides direct, vectorised, access to the graphic device for as high performance as possible. </p> <h3>Usage</h3> <pre> string_widths_dev( strings, family = "", face = 1, size = 12, cex = 1, unit = "cm" ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>strings</code></td> <td> <p>A character vector of strings to measure</p> </td></tr> <tr valign="top"><td><code>family</code></td> <td> <p>The font families to use. Will get recycled</p> </td></tr> <tr valign="top"><td><code>face</code></td> <td> <p>The font faces to use. Will get recycled</p> </td></tr> <tr valign="top"><td><code>size</code></td> <td> <p>The font size to use. Will get recycled</p> </td></tr> <tr valign="top"><td><code>cex</code></td> <td> <p>The cex multiplier to use. Will get recycled</p> </td></tr> <tr valign="top"><td><code>unit</code></td> <td> <p>The unit to return the width in. Either <code>"cm"</code>, <code>"inches"</code>, <code>"device"</code>, or <code>"relative"</code></p> </td></tr> </table> <h3>Value</h3> <p>A numeric vector with the width of each of the strings given in <code>strings</code> in the unit given in <code>unit</code> </p> <h3>See Also</h3> <p>Other device metrics: <code><a href="string_metrics_dev.html">string_metrics_dev</a>()</code> </p> <h3>Examples</h3> <pre> # Get the widths as measured in cm (default) string_widths_dev(c('a string', 'an even longer string')) </pre> <hr /><div style="text-align: center;">[Package <em>systemfonts</em> version 1.0.4 <a href="00Index.html">Index</a>]</div> </body></html>