MAIDR JavaScript API
    Preparing search index...

    Class TactileBrailleAbstract

    Translates plain text into braille cells for a tactile display's text line.

    This is a deliberately small, self-contained uncontracted (grade 1) table rather than a binding to a full translation library. A complete translator such as liblouis ships tens of megabytes of tables and must be served as static assets, which MAIDR — distributed as a single inlined bundle — cannot do. Data labels are short, mostly alphanumeric, and read under a fingertip one line at a time, so a table covering letters, digits and the punctuation that actually appears in axis values buys nearly all of the benefit at none of the distribution cost.

    A device SDK that can translate is always preferred when one is available; this table is the floor that keeps the text line working when it is not, so the feature never goes silent for want of a translator.

    Characters with no entry are emitted as blank cells. A blank reads as absence, whereas an approximate substitution reads as data and would be indistinguishable from a real value.

    Index

    Properties

    CONTINUATION_CELL: 192 = 0b1100_0000

    Dots 7 and 8 together, used to mark that the text continues past the end of the line. Not a letter in any table, so it cannot be mistaken for content.

    Methods

    • Translates text into braille cell patterns.

      A number sign is emitted once at the start of each run of digits rather than before every digit, and a period between two digits is treated as a decimal point.

      Parameters

      • text: string

        The text to translate

      Returns number[]

      One byte per cell, bit 0 being dot 1

    • Number of windows a cell buffer occupies on a line of a given width.

      Parameters

      • cells: readonly number[]

        The full translated buffer

      • cellCount: number

        Cells on the device's text line

      Returns number

    • Slices one window out of a cell buffer, padding the last one with blanks.

      The device reports its panning keys but never scrolls its own buffer, so every window is re-sent from the first cell of the line. A continuation marker replaces the final cell whenever more text follows, so a reader knows to pan rather than assuming the value ended.

      Parameters

      • cells: readonly number[]

        The full translated buffer

      • cellCount: number

        Cells on the device's text line

      • windowIndex: number

        Zero-based window to return, clamped into range

      Returns number[]

      Exactly cellCount cells