bm_shift | R Documentation |
Shifts non-padding elements within bitmaps by trimming on a specified side and padding on the other while preserving the width and height of the original bitmap.
bm_shift( bm_object, value = 0L, top = NULL, right = NULL, bottom = NULL, left = NULL )
bm_object |
Either a |
value |
Integer value for the new pixels. |
top |
Number of pixels to shift towards the top side. |
right |
Number of pixels to shift towards the right side. |
bottom |
Number of pixels to shift towards the bottom side. |
left |
Number of pixels to shift towards the left side. |
This function is a convenience wrapper around bm_trim()
and bm_extend()
.
Either a bm_bitmap()
, bm_list()
, or bm_font()
object.
bm_trim()
and bm_extend()
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 <- bm_shift(capital_r, bottom = 2L, right = 1L) print(capital_r, px = c("-", "#"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.