Skip to contents

Calculate string width in inches based on font (Times New Roman, Arial, etc.), font size, font style (bold, italic, bold-italic etc.), and text indent.

Usage

rtf_strwidth(tbl)

Arguments

tbl

A data frame

Value

an object with string width corresponding to each cell in the data frame tbl

Specification

The contents of this section are shown in PDF user manual only.

Examples

library(dplyr)
tbl <- data.frame(
  x = rep("This is a long sentence", 5),
  y = "short"
)
tbl %>%
  rtf_body(text_font = c(1, 3)) %>%
  r2rtf:::rtf_strwidth()
#>          [,1]      [,2]
#> [1,] 1.136936 0.3211806
#> [2,] 1.136936 0.3211806
#> [3,] 1.136936 0.3211806
#> [4,] 1.136936 0.3211806
#> [5,] 1.136936 0.3211806