as_bm_list() turns an existing object into a bm_list() object. In particular as_bm_list.character() turns a string into a bitmap list.

as_bm_list(x, ...)

# S3 method for default
as_bm_list(x, ...)

# S3 method for list
as_bm_list(x, ...)

# S3 method for character
as_bm_list(x, ..., font = bm_font())

Arguments

x

An object that can reasonably be coerced to a bm_list() object.

...

Further arguments passed to or from other methods.

font

A bm_font() object that contains all the characters within x.

Value

A bm_list() object.

See also

Examples

# as_bm_list.character() font_file <- system.file("fonts/spleen/spleen-8x16.hex.gz", package = "bittermelon") font <- read_hex(font_file) bml <- as_bm_list("RSTATS", font = font) bml <- bm_extend(bml, sides = 1L, value = 0L) bml <- bm_extend(bml, sides = c(2L, 1L), value = 2L) bm <- do.call(cbind, bml) print(bm, px = c(" ", "#", "X"))
#> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #> X XX XX XX XX XX X #> X XX XX XX XX XX X #> X XX XX XX XX XX X #> X ###### XX ###### XX ######## XX ##### XX ######## XX ###### X #> X ## ## XX ## XX ## XX ## ## XX ## XX ## X #> X ## ## XX ## XX ## XX ## ## XX ## XX ## X #> X ## ## XX ## XX ## XX ## ## XX ## XX ## X #> X ###### XX ##### XX ## XX ####### XX ## XX ##### X #> X ## ## XX ## XX ## XX ## ## XX ## XX ## X #> X ## ## XX ## XX ## XX ## ## XX ## XX ## X #> X ## ## XX ## XX ## XX ## ## XX ## XX ## X #> X ## ## XX ## XX ## XX ## ## XX ## XX ## X #> X ## ## XX ###### XX ## XX ## ## XX ## XX ###### X #> X XX XX XX XX XX X #> X XX XX XX XX XX X #> X XX XX XX XX XX X #> X XX XX XX XX XX X #> X XX XX XX XX XX X #> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX