str_metrics: Get font metrics for a string.
Description
Compute the width, ascent and descent of a single
string in points using Cairo text measurement.
Usage
str_metrics(
x,
fontname = "sans",
fontsize = 12,
bold = FALSE,
italic = FALSE,
fontfile = ""
)
Value
A named numeric vector with elements width,
ascent and descent (unit is points).
Arguments
- 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 systemfonts.
See Also
Other functions for font metrics:
m_str_extents(),
strings_sizes()