bitmap_text_coords {lofifonts}R Documentation

Create a data.frame of pixel coordinate information of the rendered text

Description

Create a data.frame of pixel coordinate information of the rendered text

Usage

bitmap_text_coords(text, font = "unifont", dx = 0L, dy = 0L, missing = NULL)

Arguments

text

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

font

Name of bitmap font, or a 'lofi' font object. Default: 'unifont'. Use get_lofi_names('bitmap') to retrieve a list of all valid bitmap fonts included in this package. To create a 'lofi' font object use convert_bm_font_to_lofi()

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 coordinate information

char_idx

The index of the glyph within the provided text string

codepoint

Unicode codepoint (integer)

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 bitmap text functions: bitmap_text_matrix(), bitmap_text_raster()

Examples

bitmap_text_coords('Hi')

[Package lofifonts version 0.1.3 Index]