bm_compose: Compose graphemes in a bitmap list by applying combining...

View source: R/bm_compose.R

bm_composeR Documentation

Compose graphemes in a bitmap list by applying combining marks

Description

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 by is_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().

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().

Value

A bm_list() object.

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)
  print(bm_compose(bml))

bittermelon documentation built on June 25, 2024, 5:09 p.m.