Skip to contents

A <text> element at x and y, with its text escaped by esc().

Usage

text_el(x, y, label, size, fill, weight = 400, anchor = "start")

Arguments

x, y

Where the text is anchored, in pixels.

label

The text.

size

The font size, in pixels.

fill

The colour.

weight

The font weight: 400, or 600 for bold.

anchor

"start", "middle" or "end": the part of the text that is at x.

Value

A <text> element, as a character string.

Examples

rghcard:::text_el(24, 46, "R & Python", 20, "#e6edf3", 600)
#> [1] "<text x=\"24.0\" y=\"46.0\" font-size=\"20\" font-weight=\"600\" fill=\"#e6edf3\" text-anchor=\"start\">R &amp; Python</text>"