bm_font: Bitmap font object

View source: R/bm_font.R

bm_fontR Documentation

Bitmap font object

Description

bm_font() creates a bitmap font object.

Usage

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

 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)

trevorld/bittermelon documentation built on Dec. 24, 2024, 10:33 p.m.