BRLTTY Reference Manual: Translation Tables

Next Previous Contents

## 6. Translation Tables

BRLTTY uses two translation tables to govern the mapping from bytes to dot combinations.

## 6.1 Text Translation

The first, and most important, is the text translation table. BRLTTY is initially configured to use the North American Braille Computer Code (NABCC). In addition to this default text translation table, several alternatives are provided:

brf

  good for viewing `.brf` files in text editor or pager

cz

  Czech (iso-8859-2)

da

  Danish (iso-8859-1)

de

  German (iso-8859-1)

en_UK

  English (United Kingdom)

en_US

  English (United States)

es

  Spanish (iso-8859-1)

fi1

  Finnish (iso-8859-1)

fi2

  Finnish (iso-8859-1)

fr_CA

  French (Canada)

fr_FR

  French (France)

fr-2007

  Unified French (iso-8859-1)

fr-cbifs

  Code Braille Informatique Français Standard (iso-8859-1)

it

  Italian (iso-8859-1)

nabcc

  North American Braille Computer Code (iso-8859-1)

no-generic

  Norwegian (with support for other languages)

no-oub

  Norwegian (Offentlig Utvalg for Blindeskrift)

pl

  Polish (iso-8859-2)

pt

  Portuguese (iso-8859-1)

ru

  Russian (koi8-r)

se

  Swedish (1996 standard)

se-old

  Swedish (1989 standard)

vni

  Vietnamese (iso-8859-1)

See the -t command line option, the text-table configuration file directive, and the --with-text-table build option for details regarding how to use an alternate text translation table.

## 6.2 Attributes Translation

The attributes translation table is used when BRLTTY is displaying screen attributes rather than screen content (see the DISPMD command). Each of the eight braille dots represents one of the eight `VGA` attribute bits. The following attributes translation tables are provided:

attributes

  The lefthand column represents the foreground colours:

  Dot 1

    Red

  Dot 2

    Green

  Dot 3

    Blue

  Dot 7

    Bright

  The righthand column represents the background colours:
  Dot 4

    Red

  Dot 5

    Green

  Dot 6

    Blue

  Dot 8

    Blink

  A dot is raised when its corresponding attribute bit is on. This is the default attributes translation table because it's the most intuitive. One of its problems, though, is that it's difficult to discern the difference between normal (white on black) and reverse (black on white) video.
attrib

  The lefthand column represents the foreground colours:

  Dot 1

    Red

  Dot 2

    Green

  Dot 3

    Blue

  Dot 7

    Bright

  The righthand column represents the background colours:
  Dot 4

    Red

  Dot 5

    Green

  Dot 6

    Blue

  Dot 8

    Blink

  A background bit being on triggers its corresponding dot, whereas a foreground bit being off triggers its corresponding dot. This unintuitive logic actually makes it easier to read the most commonly used attribute combinations.

See the -a command line option, the attributes-table configuration file directive, and the --with-attributes-table build option for details regarding how to use an alternate attributes translation table.

## 6.3 Table Format

A translation table consists of a sequence of directives, one per line, which define how each possible byte value is to be represented in braille. White-space (blanks, tabs) at the beginning of a line, as well as before and/or after any operand of any directive, is ignored. Lines containing only white-space are ignored. If the first non-white-space character of a line is "#" then that line is a comment and is ignored.

The following directives are provided:

`byte` byte dots # comment

  Use the `byte` directive to specify how a byte (character) is to be represented in braille. See the text translation tables for examples of its use. Since this is by far the most commonly used directive, the `byte` keyword itself is optional.

  byte

    The byte being defined. It may be:

    - Any single character other than a backslash or a white-space character.
    - A backslash-prefixed special character. These are:
      \\

        A literal backslash.

      \#

        A literal number sign.

      \x##

        The two-digit hexadecimal representation of any character.

      \X##

        ... (the case of the X and of the digits isn't significant)

  dots

    The braille representation of the byte. It is a sequence of one to eight dot numbers. If the dot number sequence is enclosed within parentheses then the dot numbers may be separated from one another by white-space. A dot number is a digit within the range `1`-`8` as defined by the Standard Braille Dot Numbering Convention. The special dot number `0` is recognized when not enclosed within parentheses, and means no dots; it may not be used in conjunction with any other dot number.

  Examples:

  - byte a 1
  - b 12
  - c (14)
  - d ( 1 4 5 )
  - \\ 12567
  - \x20 0
`dot` dot state # comment

  Use the `dot` directive to specify how the undefined bytes are to be represented in braille. See the attributes translation tables for examples of its use. The default is that all dots are `on`.

  dot

    The dot being defined. It is a single digit within the range `1`-`8` as defined by the Standard Braille Dot Numbering Convention.

  state

    When the dot is raised. It may be:

    `on`

      The dot is raised.

    `off`

      The dot isn't raised.

    `=`bit

      The dot is raised if the named bit is on (set to 1).

    `~`bit

      The dot is raised if the named bit is off (set to 0).

    The names of the bits are:

    0X01

      fg-blue

    0X02

      fg-green

    0X04

      fg-red

    0X08

      fg-bright

    0X10

      bg-blue

    0X20

      bg-green

    0X40

      bg-red

    0X80

      blink

  Examples:

  - dot 1 on
  - dot 2 off
  - dot 3 =fg-red
  - dot 4 ~bg-blue

Next Previous Contents