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
# NOT RUN { # The first run can be slow when font caches are missing # as font files are then being scanned to build those font caches. str_metrics("Hello World!") # }
Run the code above in your browser using DataLab