bm_pad {bittermelon} | R Documentation |
Adjust bitmap padding lengths
Description
bm_pad()
adjusts bitmap padding lengths.
Usage
bm_pad(
bm_object,
value = 0L,
type = c("exact", "extend", "trim"),
sides = NULL,
top = NULL,
right = NULL,
bottom = NULL,
left = NULL
)
Arguments
bm_object |
Either a |
value |
Integer value for the new pixels. |
type |
Either "exact", '"extend", or "trim". "exact" makes sure the padding is exactly the indicated amount, "extend" does not trim any padding if existing padding is more than the indicated amount, and "trim" does not extend any padding if existing padding is less than the indicated amount. |
sides |
If not |
top |
Desired number of pixels of padding on the top. |
right |
Desired number of pixels of padding on the right. |
bottom |
Desired number of pixels of padding on the bottom. |
left |
Desired number of pixels of padding on the left. |
Value
Either a bm_bitmap()
, bm_list()
, or bm_font()
object.
See Also
bm_extend()
, bm_resize()
, and bm_trim()
Examples
font_file <- system.file("fonts/spleen/spleen-8x16.hex.gz", package = "bittermelon")
font <- read_hex(font_file)
capital_r <- font[[str2ucp("R")]]
print(capital_r, px = c(".", "#"))
capital_r_padded <- bm_pad(capital_r, sides = 2L)
print(capital_r_padded, px = c(".", "#"))