str_extents: Compute string extents.

View source: R/str-metrics.R

str_extentsR Documentation

Compute string extents.

Description

Determines the width and height of a bounding box that's big enough to (just) enclose the provided text.

Usage

str_extents(
  x,
  fontname = "sans",
  fontsize = 12,
  bold = FALSE,
  italic = FALSE,
  fontfile = ""
)

Arguments

x

Character vector of strings to measure

fontname

Font name

fontsize

Font size

bold, italic

Is text bold/italic?

fontfile

Font file

Examples

str_extents(letters)
str_extents("Hello World!", bold = TRUE, italic = FALSE,
  fontname = "sans", fontsize = 12)

gdtools documentation built on Oct. 15, 2023, 5:07 p.m.