Convenience wrapper around text_layer for the case where no
meshes are involved: the labels are drawn onto the background described by
the render options. Screen-space labels (space = "screen") do not use
a camera at all, so this is the quick way to turn a label into an image or to
decorate an empty canvas; world-space labels need a camera.
Arguments
- positions
Anchor positions, see
text_layer.- text
Character vector of labels, see
text_layer.- camera
A camera list from
camera()orcamera_auto(). Ignored for screen-space labels; whenNULL, a default camera is used.- options
Render options from
render_options().- ...
Further arguments passed to
text_layer(for examplesize,space,color,halo_color).
Examples
img <- render_text(c(20, 20), "figure A", space = "screen",
adj = c(0, 1), size = 24,
options = render_options(width = 300, height = 80))
tmp <- tempfile(fileext = ".png")
write_png(img, tmp)