bm_font: Bitmap font object

Description Usage Arguments Details Value See Also Examples

View source: R/bm_font.R

Description

bm_font() creates a bitmap font object.

Usage

1
bm_font(x = bm_list(), comments = NULL, properties = NULL)

Arguments

x

Named list of bm_bitmap() objects. Names must be coercible by Unicode::as.u_char().

comments

An optional character vector of (global) font comments.

properties

An optional named list of font metadata.

Details

bm_font() is a named list. The names are of the form “U+HHHH” or “U+HHHHH”. where the H are appropriate hexadecimal Unicode code points. It is a subclass of bm_list().

Value

A named list with a “bm_font” subclass.

See Also

is_bm_font(), [as_bm_font(), hex2ucp()]

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)
 is_bm_font(font)

 # number of characters in font
 length(font)

 # print out "R"
 R_glyph <- font[[str2ucp("R")]]
 print(R_glyph, px = c(".", "#"))

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