bm_padding_lengths {bittermelon} | R Documentation |
bm_padding_lengths()
computes the padding lengths of a
target value for the top, right, bottom, and left sides of the bitmap.
If the entire bitmap is of the target value then the left/right and top/bottom
will simply split the width/height in half.
bm_padding_lengths(bm_object, value = 0L)
bm_object |
Either a |
value |
The value of the “padding” integer to compute lengths for. |
If bm_object
is a bm_bitmap()
object then a integer vector of length four
representing the padding lengths for the top, right, bottom, and left sides respectively.
If bm_object
is a bm_list()
or bm_font()
then a list of integer vectors of length four.
font_file <- system.file("fonts/spleen/spleen-8x16.hex.gz", package = "bittermelon")
font <- read_hex(font_file)
# add a border to an "R"
capital_r <- font[[str2ucp("R")]]
print(capital_r, px = c(".", "@"))
print(bm_padding_lengths(capital_r))