bm_shadow: Bitmap shadow, bold, and glow effects

View source: R/bm_shadow.R

bm_shadowR Documentation

Bitmap shadow, bold, and glow effects

Description

bm_shadow() adds a basic "shadow" effect to the bitmap(s). bm_bold() is a variant with different defaults to create a basic "bold" effect. bm_glow() adds a basic "glow" effect to the bitmap(s).

Usage

bm_shadow(
  bm_object,
  value = 2L,
  top = NULL,
  right = NULL,
  bottom = NULL,
  left = NULL,
  extend = TRUE
)

bm_bold(
  bm_object,
  value = 1L,
  top = NULL,
  right = NULL,
  bottom = NULL,
  left = NULL,
  extend = TRUE
)

bm_glow(bm_object, value = 2L, extend = TRUE, corner = FALSE)

Arguments

bm_object

Either a bm_bitmap(), bm_list(), or bm_font() object.

value

The integer value for the shadow, bold, or glow effect.

top

How many pixels above should the shadow go.

right

How many pixels right should the shadow go. if top, right, bottom, and left are all NULL then defaults to 1L.

bottom

How many pixels below should the shadow go. if top, right, bottom, and left are all NULL then defaults to 1L for bm_shadow() and 0L for bm_embolden().

left

How many pixels left should the shadow go.

extend

Make the bitmap larger to give the new glyph more "room".

corner

Fill in the corners.

Value

Either a bm_bitmap(), bm_list(), or bm_font() object.

See Also

bm_extend() and bm_shift()

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 = px_ascii)
 print(bm_shadow(capital_r), px = px_ascii)
 print(bm_bold(capital_r), px = px_ascii)
 print(bm_glow(capital_r), px = px_ascii)
 print(bm_glow(capital_r, corner = TRUE), px = px_ascii)


bittermelon documentation built on Feb. 16, 2023, 8:08 p.m.