R/str-metrics.R
str_metrics.Rd
Get font metrics for a string.
str_metrics( x, fontname = "sans", fontsize = 12, bold = FALSE, italic = FALSE, fontfile = "" )
Character vector of strings to measure
Font name
Font size
Is text bold/italic?
Font file
A named numeric vector
str_metrics("Hello World!") #> width ascent descent #> 69.312 9.120 0.168