Debian Codegraph @

Documents/README.TextTables

raw
1 ~~~~~~~~~~~
2 Text Tables
3 ~~~~~~~~~~~
4
5 .. include:: prologue.rst
6
7 Description
8 ===========
9
10 Files with names of the form ``*.ttb`` are text tables, and with names of the
11 form ``*.tti`` are text subtables. They are used by BRLTTY to translate the
12 characters on the screen into their corresponding 8-dot computer braille
13 representations (see |README.BrailleDots| for details).
14
15 Text tables can usually be found in the ``/etc/brltty/Text/`` directory (see
16 |README.Customize| for more details). See `Text Table List`_ for a list of
17 BRLTTY's text tables.
18
19 A text table consists of a sequence of directives, one per line, which define
20 how each character is to be represented in braille. UTF-8 character encoding
21 must be used. Whitespace (blanks, tabs) at the beginning of a line, as well as
22 before and/or after any operand of any directive, is ignored. Lines containing
23 only whitespace are ignored. If the first non-whitespace character of a line
24 is ``#`` then that line is a comment and is ignored.
25
26 The precedence for determining the braille representation for a character is as
27 follows:
28
29 1) If the character is within the Unicode braille Row (U+2800 through U+28FF)
30 then its low-order eight bits are used as follows:
31
32 === ======== ===
33 Hex Binary Dot
34 --- -------- ---
35 01 00000001 1
36 02 00000010 2
37 04 00000100 3
38 08 00001000 4
39 10 00010000 5
40 20 00100000 6
41 40 01000000 7
42 80 10000000 8
43 === ======== ===
44
45 2) If the character is within the Unicode private use row U+F000 through U+F0FF
46 then its low-order byte is:
47
48 A) interpreted as a single-byte character within the local character set
49 B) translated to Unicode
50 C) reprocessed
51
52 3) An explicit representation (defined via `The Char Directive`_,
53 `The Glyph Directive`_, or `The Byte Directive`_).
54
55 4) An equivalent representation (defined via `The Alias Directive`_).
56
57 5) The explicit representation of the Unicode base character.
58
59 6) The explicit representation of the transliterated ASCII character.
60
61 7) The explicit representation of the Unicode Replacement Character (U+FFFD).
62
63 8) The explicit representation of a question mark (``?``).
64
65 9) All eight braille dots.
66
67 Directives
68 ==========
69
70 .. |character operand| replace::
71 The character being defined.
72 See `The String Operand`_ for details.
73
74 .. |byte operand| replace::
75 The character being defined.
76 It may be specified in any of the ways supported by `The String Operand`_
77 except that the Unicode-specific forms (``\u``, ``\U``, ``\<``) may not be used.
78
79 .. |dots operand| replace::
80 The braille representation for the character being defined.
81 See `The Dots Operand`_ for details.
82
83 .. |cell operand| replace::
84 The braille representation for the character being tested.
85 See `The Cell Operand`_ for details.
86
87 The Char Directive
88 ------------------
89
90 .. parsed-literal:: char *character* *dots* # *comment*
91
92 Use this directive to specify how a Unicode character is to be represented in
93 braille. A character defined via this directive can also be entered from a
94 braille keyboard. If several characters have the same braille representation
95 then only one of them should be defined via this directive - the others should
96 be defined via `The Glyph Directive`_ (which has the same syntax). If more than
97 one character with the same braille representation is defined via this
98 directive (which is allowed for backward compatibility) then the first one is
99 used when entered from a braille keyboard.
100
101 *character*
102 |character operand|
103
104 *dots*
105 |dots operand|
106
107 Examples::
108
109 char a 1
110 char b (12)
111 char c ( 4 1 )
112 char \\ 12567
113 char \s 0
114 char \x20 ()
115 char \<LATIN_SMALL_LETTER_D> 145
116
117 The Glyph Directive
118 -------------------
119
120 .. parsed-literal:: glyph *character* *dots* # *comment*
121
122 Use this directive to specify how a Unicode character is to be represented in
123 braille. A character defined via this directive is output-only - it can't
124 be entered from a braille keyboard.
125
126 *character*
127 |character operand|
128
129 *dots*
130 |dots operand|
131
132 See `The Char Directive`_ for examples.
133
134 The Input Directive
135 -------------------
136
137 .. parsed-literal:: input *character* *dots* # *comment*
138
139 Use this directive to specify how a Unicode character is to be entered from a
140 braille keyboard. A character defined via this directive is input-only - its
141 actual braille representation isn't defined.
142
143 *character*
144 |character operand|
145
146 *dots*
147 |dots operand|
148
149 See `The Char Directive`_ for examples.
150
151 The Alias Directive
152 -------------------
153
154 .. parsed-literal:: alias *from* *to* # *comment*
155
156 Use this directive to define the *from* Unicode character such that it has the
157 same braille representation as the *to* Unicode character. See
158 `The String Operand`_ for details on how to specify both operands.
159
160 The Byte Directive
161 ------------------
162
163 .. parsed-literal:: byte *byte* *dots* # *comment*
164
165 Use this directive to specify how a character in the local character set is to
166 be represented in braille. It has been retained for backward compatibility but
167 should not be used. Unicode characters should be defined (via either
168 `The Char Directive`_ or `The Glyph Directive`_) so that the text table remains
169 valid regardless of what the local character set is.
170
171 *byte*
172 |byte operand|
173
174 *dots*
175 |dots operand|
176
177 The IfGlyph Directive
178 ---------------------
179
180 .. parsed-literal:: ifGlyph *character* *directive*
181
182 Use this directive to only process one or more directives if a character has a
183 braille representation.
184
185 *character*
186 |character operand|
187
188 *directive*
189 |directive operand|
190
191 Examples::
192
193 ifGlyph C alias \u2103 C # degree Celsius
194
195 The IfNotGlyph Directive
196 ------------------------
197
198 .. parsed-literal:: ifNotGlyph *character* *directive*
199
200 Use this directive to only process one or more directives if a character
201 doesn't have a braille representation.
202
203 *character*
204 |character operand|
205
206 *directive*
207 |directive operand|
208
209 Examples::
210
211 ifNotGlyph \s glyph \s 0
212
213 The IfInput Directive
214 ---------------------
215
216 .. parsed-literal:: ifInput *cell* *directive*
217
218 Use this directive to only process one or more directives if a character can be
219 entered from a braille keyboard.
220
221 *cell*
222 |cell operand|
223
224 *directive*
225 |directive operand|
226
227 The IfNotInput Directive
228 ------------------------
229
230 .. parsed-literal:: ifNotInput *cell* *directive*
231
232 Use this directive to only process one or more directives if a character can't
233 be entered from a braille keyboard.
234
235 *cell*
236 |cell operand|
237
238 *directive*
239 |directive operand|
240
241 .. include:: nesting-directives.rst
242 .. include:: variable-directives.rst
243 .. include:: condition-directives.rst
244
245 Operands
246 ========
247
248 .. include:: string-operand.rst
249
250 The Dots Operand
251 ----------------
252
253 A *dots* operand is a sequence of one to eight dot numbers. If the dot numbers
254 are enclosed within (parentheses) then they may be separated from one another
255 by whitespace. A dot number is a digit within the range ``1``-``8``
256 as defined by the standard braille dot numbering convention (see
257 |README.BrailleDots| for details). The special dot number ``0`` is recognized
258 when not enclosed within (parentheses), and means no dots - it may not be used
259 in conjunction with any other dot number.
260
261 The Cell Operand
262 ----------------
263
264 A *cell* operand is a sequence of one to eight dot numbers. A dot number is
265 a digit within the range ``1``-``8`` as defined by the standard braille dot
266 numbering convention (see |README.BrailleDots| for details). The special dot
267 number ``0`` is recognized, and means no dots - it may not be used in
268 conjunction with any other dot number.
269
270 Text Table List
271 ===============
272
273 .. csv-table::
274 :header-rows: 1
275 :file: text-table.csv
276