| str_metrics | R Documentation |
Compute the width, ascent and descent of a single string in points using Cairo text measurement.
str_metrics(
x,
fontname = "sans",
fontsize = 12,
bold = FALSE,
italic = FALSE,
fontfile = ""
)
x |
Character vector of strings to measure (only the first element is used). |
fontname |
Font name. |
fontsize |
Font size in points. |
bold, italic |
Is text bold/italic? |
fontfile |
Path to a font file. If empty, the font is
resolved by name via |
A named numeric vector with elements width,
ascent and descent (unit is points).
This function will be deprecated in a future release.
Use strings_sizes() instead.
Other functions for font metrics:
m_str_extents(),
strings_sizes()
str_metrics("Hello World!")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.