plot_shape: Preview shaped text and the metrics for the text box

View source: R/shape_text.R

plot_shapeR Documentation

Preview shaped text and the metrics for the text box

Description

This function allows you to preview the layout that shape_text() calculates. It is purely meant as a sanity check to make sure that the values calculated are sensible and shouldn't be used as a plotting function for rendering text on its own.

Usage

plot_shape(shape, id = 1)

Arguments

shape

The output of a call to shape_text()

id

The index of the text run to show in case shape contains multiples

Value

This function is called for its side effects

Examples

arab_text <- lorem_text("arabic", 2)
shape <- shape_text(
  arab_text,
  max_width = 5,
  indent = 0.2
)

try(
 plot_shape(shape)
)


textshaping documentation built on April 4, 2025, 5:24 a.m.