bm_edit: Edit a bitmap via text editor

Description Usage Arguments Details Value Examples

View source: R/bm_edit.R

Description

Edit a binary bitmap in a text editor.

Usage

1
bm_edit(bitmap, editor = getOption("editor"))

Arguments

bitmap

bm_bitmap() object. It will be coerced into a binary bitmap via bm_clamp().

editor

Text editor. See utils::file.edit() for more information.

Details

Represent zeroes with a . and ones with a @ (as in the yaff font format). You may also add/delete rows/columns but the bitmap must be rectangular.

Value

A bm_bitmap() object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  font_file <- system.file("fonts/spleen/spleen-8x16.hex.gz", package = "bittermelon")
  font <- read_hex(font_file)
  r <- font[[str2ucp("R")]]

  # requires users to manually close file in text editor
  ## Not run: 
    edited_r <- bm_edit(r)
    print(edited_r, px = px_ascii)
  
## End(Not run)

bittermelon documentation built on Nov. 2, 2021, 1:06 a.m.