bm_compose() simplifies bm_list() object
by applying combining marks to preceding glpyhs (composing new graphemes).
Usage
bm_compose(bml, pua_combining = character(0), ...)Arguments
- bml
A
bm_list()object. All combining marks need appropriate Unicode code point names to be recognized byis_combining_character().- pua_combining
Additional Unicode code points to be considered as a “combining” character such as characters defined in the Private Use Area (PUA) of a font.
- ...
Passed to
bm_overlay().
Value
A bm_list() object.
Details
bm_compose() identifies combining marks by their name using is_combining_character().
It then combines such marks with their immediately preceding glyph using bm_overlay().
Examples
font_file <- system.file("fonts/spleen/spleen-8x16.hex.gz", package = "bittermelon")
font <- read_hex(font_file)
grave <- font[[str2ucp("`")]]
a <- font[[str2ucp("a")]]
bml <- bm_list(`U+0061` = a, `U+0300` = grave)
print(bml)
#> $`U+0061`
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░█████░░
#> ░░░░░██░
#> ░██████░
#> ██░░░██░
#> ██░░░██░
#> ██░░░██░
#> ░██████░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#>
#> $`U+0300`
#> ░░░░░░░░
#> ░░██░░░░
#> ░░░██░░░
#> ░░░░██░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#>
#> attr(,"class")
#> [1] "bm_list" "list"
print(bm_compose(bml))
#> $`U+0061 U+0300`
#> ░░░░░░░░
#> ░░██░░░░
#> ░░░██░░░
#> ░░░░██░░
#> ░░░░░░░░
#> ░█████░░
#> ░░░░░██░
#> ░██████░
#> ██░░░██░
#> ██░░░██░
#> ██░░░██░
#> ░██████░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#> ░░░░░░░░
#>
#> attr(,"class")
#> [1] "bm_list" "list"