wrap string given a Truetype font
Arguments
- str
(
string
,character
, orlist
)
string to be wrapped. If it is avector
or alist
, it will be looped as alist
and returned withunlist(use.names = FALSE)
.- width
(
numeric(1)
)
width, in characters, that the text should be wrapped to.- fontspec
(
font_spec
)
a font_spec object specifying the font information to use for calculating string widths and heights, as returned byfont_spec()
.- min_ok_chars
(
numeric(1)
)
number of minimum characters that remain on either side when a word is split.- collapse
(
string
orNULL
)
collapse character used to separate segments of words that have been split and should be pasted together. This is usually done internally with"\n"
to update the wrapping along with other internal values.- wordbreak_ok
(
logical(1)
)
should breaking within a word be allowed? If,FALSE
, attempts to wrap a string to a width narrower than its widest word will result in an error.