Skip to main content

Module braille

Module braille 

Source
Expand description

Unicode Braille Patterns (U+2800..=U+28FF), addressed as a 2-column by 4-row dot grid.

Braille cells pack eight independently-settable dots into one glyph, giving roughly 2x the horizontal and 4x the vertical resolution of a plain block glyph for plotting points or thin lines. Each dot has a fixed bit in the 8-bit pattern index; combine the ones you want set with bitwise OR and pass the result to glyph().

(0,0) DOT_1  (1,0) DOT_4
(0,1) DOT_2  (1,1) DOT_5
(0,2) DOT_3  (1,2) DOT_6
(0,3) DOT_7  (1,3) DOT_8

Constants§

BLANK
The empty braille cell (no dots set), (U+2800, distinct from a plain space).
DOTS
The 2x4 dot-position table, indexed [row][col], giving the bit for each cell in the braille dot grid.
DOT_1
Dot at column 0, row 0.
DOT_2
Dot at column 0, row 1.
DOT_3
Dot at column 0, row 2.
DOT_4
Dot at column 1, row 0.
DOT_5
Dot at column 1, row 1.
DOT_6
Dot at column 1, row 2.
DOT_7
Dot at column 0, row 3.
DOT_8
Dot at column 1, row 3.

Functions§

glyph
The glyph for pattern, a bitmask of the eight DOT_* constants (or values from DOTS) OR’d together.