powered by
This function is a simple wrapper around systemfonts::string_metrics_dev(). It determines widths, ascent and descent in inches.
systemfonts::string_metrics_dev()
This function will replace the following functions defined in this file: str_extents(), str_metrics() and m_str_extents().
str_extents()
str_metrics()
m_str_extents()
strings_sizes( x, fontname = "sans", fontsize = 10, bold = FALSE, italic = FALSE )
A character vector of strings to measure. All arguments are vectorized and recycled to match the length of x.
x
A character vector specifying the font family name (e.g., "sans", "serif", "mono"). Default is "sans". This argument is vectorized.
A numeric vector specifying the font size in points. Default is 10. This argument is vectorized.
A logical vector indicating whether the text should be bold. Default is FALSE. This argument is vectorized.
A logical vector indicating whether the text should be italic. Default is FALSE. This argument is vectorized.
strings_sizes(letters) strings_sizes("Hello World!", bold = TRUE, italic = FALSE, fontname = "sans", fontsize = 12)
Run the code above in your browser using DataLab