print.bm_bitmap {bittermelon} | R Documentation |
print.bm_bitmap()
prints a representation of bitmap objects to the terminal.
It is a wrapper around format.bm_bitmap()
which converts bitmap objects
to a character vector.
px_unicode
and px_ascii
are builtin character vectors intended for use with the px
argument (the former contains Unicode “Block Elements” while the latter is purely ASCII).
## S3 method for class 'bm_bitmap'
print(x, ..., px = getOption("bittermelon.px", px_unicode),
fg = getOption("bittermelon.fg", FALSE),
bg = getOption("bittermelon.bg", FALSE),
compress = getOption("bittermelon.compress", "none"))
## S3 method for class 'bm_bitmap'
format(x, ..., px = getOption("bittermelon.px", px_unicode),
fg = getOption("bittermelon.fg", FALSE),
bg = getOption("bittermelon.bg", FALSE),
compress = getOption("bittermelon.compress", "none"))
px_unicode
px_ascii
x |
A |
... |
Further arguments passed to or from other methods. |
px |
Character vector of the pixel to use for each integer value i.e.
The first character for integer |
fg |
R color strings of foreground colors to use.
Requires suggested package |
bg |
R color strings of background colors to use.
Requires suggested package |
compress |
If |
An object of class character
of length 20.
An object of class character
of length 20.
A character vector of the string representation (print.bm_bitmap()
does this invisibly).
As a side effect print.bm_bitmap()
prints out the string representation to the terminal.
font_file <- system.file("fonts/spleen/spleen-8x16.hex.gz", package = "bittermelon")
font <- read_hex(font_file)
bm_R <- font[[str2ucp("R")]]
print(bm_R, px = c(" ", "#"))
bm_8 <- font[[str2ucp("8")]]
bm_8_with_border <- bm_extend(bm_extend(bm_8, left = 1L),
sides = 1L, value = 2L)
print(bm_8_with_border, px = c(".", "@", "X"))
if (require("crayon") && crayon::has_color()) {
print(bm_8_with_border, px = " ", bg = c("white", "blue", "red"))
}