vector_text_coords {lofifonts}R Documentation

Create data.frame of glyph information for the given text.

Description

Text input can contain multiple lines separated by carriage returns

Usage

vector_text_coords(
  text,
  font = c("gridfont_smooth", "gridfont", "arcade"),
  dx = 0L,
  dy = 0L,
  missing = utf8ToInt("?")
)

Arguments

text

Single text string. Can include carriage returns to split text over multiple lines.

font

Name of vector font, or a vector 'lofi' font object. Default: 'gridfont_smooth'. Use get_lofi_names('vector') to retrieve a list of all valid vector fonts included in this package.

dx

Additional character spacing in the horizontal direction. Default: 0

dy

Additional character spacing in the vertical direction i.e. between rows of text. Default: 0

missing

Codepoint to use if glyph not found in font. Default: NULL means to use the default specified by the font internally. Otherwise it will default to the codepoint for '?'

Value

data.frame of stroke information

char_idx

The index of the character within the provided text string

codepoint

Unicode codepoint (integer)

stroke_idx

Index of the stroke within each character

x

Pixel coordinate x value for display

y

Pixel coordinate y value for display

line

Line number within input text where this character appears

x0

Original untransformed x-coordinate

y0

Original untransformed y-coordinate

See Also

Other vector text functions: vector_text_matrix(), vector_text_raster()

Examples

vector_text_coords('Hi')

[Package lofifonts version 0.1.3 Index]