Skip to contents

c() combines bitmap objects into bm_list() or bm_font() objects. In particular when using it to combine fonts the later fonts "update" the glyphs in the earlier fonts.

Usage

# S3 method for class 'bm_bitmap'
c(...)

# S3 method for class 'bm_font'
c(...)

# S3 method for class 'bm_list'
c(...)

# S3 method for class 'bm_pixmap'
c(...)

Arguments

...

bm_bitmap(), bm_list(), and/or bm_font() objects to combine.

Value

Either a bm_list() or bm_font() object. See Details for more info.

Details

The various bitmap objects are "reduced" in the following ways:

FirstSecondResult
bm_bitmap()bm_bitmap()bm_list()
bm_bitmap()bm_font()bm_font()
bm_bitmap()bm_list()bm_list()
bm_bitmap()bm_pixmap()bm_list()
bm_pixmap()bm_bitmap()bm_list()
bm_pixmap()bm_font()ERROR
bm_pixmap()bm_list()bm_list()
bm_pixmap()bm_pixmap()bm_list()
bm_font()bm_bitmap()bm_font()
bm_font()bm_font()bm_font()
bm_font()bm_list()bm_font()
bm_font()bm_pixmap()ERROR
bm_list()bm_bitmap()bm_list()
bm_list()bm_font()bm_font()
bm_list()bm_list()bm_list()
bm_list()bm_pixmap()bm_list()

When combining with a bm_font() object if any bm_bitmap() objects share the same name we only keep the last one. Although names are preserved other attributes such as font comments and properties are not guaranteed to be preserved.

Examples

font_file <- system.file("fonts/spleen/spleen-8x16.hex.gz", package = "bittermelon")
font <- read_hex(font_file)
capital_r <- font[[str2ucp("R")]]
stats <- as_bm_list("STATS", font = font)
is_bm_list(c(capital_r, capital_r))
#> [1] TRUE
rstats <- c(capital_r, stats)
print(bm_call(rstats, cbind))
#> ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
#> ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
#> ██████░░░██████░████████░█████░░████████░██████░
#> ██░░░██░██░░░░░░░░░██░░░██░░░██░░░░██░░░██░░░░░░
#> ██░░░██░██░░░░░░░░░██░░░██░░░██░░░░██░░░██░░░░░░
#> ██░░░██░██░░░░░░░░░██░░░██░░░██░░░░██░░░██░░░░░░
#> ██████░░░█████░░░░░██░░░███████░░░░██░░░░█████░░
#> ██░░░██░░░░░░██░░░░██░░░██░░░██░░░░██░░░░░░░░██░
#> ██░░░██░░░░░░██░░░░██░░░██░░░██░░░░██░░░░░░░░██░
#> ██░░░██░░░░░░██░░░░██░░░██░░░██░░░░██░░░░░░░░██░
#> ██░░░██░░░░░░██░░░░██░░░██░░░██░░░░██░░░░░░░░██░
#> ██░░░██░██████░░░░░██░░░██░░░██░░░░██░░░██████░░
#> ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
#> ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
#> ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
#> ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░