bm_flip {bittermelon} | R Documentation |
bm_flip()
flips (reflects) bitmaps horizontally, vertically, or both.
It can flip the entire bitmap or just the glyph in place.
bm_flip(bm_object, direction = "vertical", in_place = FALSE)
bm_object |
Either a |
direction |
Either "vertical" or "v", "horizontal" or "h", OR "both" or "b". |
in_place |
If |
Either a bm_bitmap()
, bm_list()
, or bm_font()
object.
font_file <- system.file("fonts/spleen/spleen-8x16.hex.gz", package = "bittermelon")
font <- read_hex(font_file)
# Print upside down
bml <- as_bm_list("RSTATS", font = font)
bml <- bm_flip(bml, "both")
bm <- bm_call(bml, cbind, direction = "RTL")
print(bm, px = px_ascii)
# Can also modify glyphs "in place"
exclamation <- font[[str2ucp("!")]]
exclamation_flipped <- bm_flip(exclamation, in_place = TRUE)
print(exclamation_flipped, px = px_ascii)