Skip to contents

A generous estimate of the width of a text, 0.6 of the font size per character, so that the text fits its space even in a wide fallback font.

Usage

text_width(x, size)

Arguments

x

Text.

size

The font size, in pixels.

Value

The width in pixels, one per element of x.

Examples

rghcard:::text_width(c("rwf", "golemworldbank"), 12)
#> [1]  21.6 100.8