unifont_combining: Get combining character code points

View source: R/combining.R

unifont_combiningR Documentation

Get combining character code points

Description

unifont_combining() returns a character vector of the code points for all the "combining" characters in Unifont.

Usage

unifont_combining(upper = TRUE, csur = TRUE, unicode = FALSE)

Arguments

upper

Include glyphs above the Unicode Basic Multilingual plane.

csur

Include (Under-)Conscript Unicode Registry glyphs.

unicode

Include combining glyphs assigned by the Unicode Consortium (i.e. not ones in the Private Use Area like the CSUR ones). By default FALSE since bittermelon::bm_compose() can usually guess that a Unicode Consortium assigned glyph is a combining glyph by using Unicode::u_char_property().

Value

A character vector of Unicode code points

See Also

Can be used with the pua_combining argument of bittermelon::bm_compose() and bittermelon::as_bm_bitmap().

Examples

uc <- unifont_combining()
print(uc)

# Tengwar with combining glyphs
if (require("bittermelon")) {
  s <- "\ue004\ue014\ue04a\ue005\ue000\ue040\ue022\ue04a\ue003\ue04e"
  font <- unifont(ucp = str2ucp(s))
  bml <- as_bm_list(s, font = font)
  to_raise <- which(names(bml) %in% c("U+E04A", "U+E04E"))
  bml[to_raise] <- bm_shift(bml[to_raise], top = 1L)
  bml <- bm_compose(bml, pua_combining = uc)
  bml <- bm_pad(bml, type = "trim", left = 1L, right = 0L)
  bm <- bm_call(bml, cbind)
  print(bm, px = px_ascii)
}

hexfont documentation built on Feb. 16, 2023, 8:34 p.m.