Liblouis User's and Programmer's Manual
2.4 Braille Indicator Opcodes ¶
Braille indicators are dot patterns which are inserted into the braille text to indicate such things as capitalization, italic type, computer braille, etc. The opcodes which define them are followed only by a dot pattern, which may be one or more cells.
modeletter attribute dots
¶capsletter dots
The dot pattern which indicates that a certain mode is entered and ends after a single character. A “mode” is a state in which dot patterns must be interpreted a certain way. For example, in uppercase mode dots ‘1’ is to be interpreted as a capital “A” and not a small “a”. In numeric mode dots ‘1’ is to be interpreted as a “1”. The attribute operand identifies the mode and corresponds with the name of the character class that determines when the mode must be entered and exited.
modeletter
is also used to mark every character when a mode must last for several characters but when there is nobegmode
definition, or when the sequence happens in the middle of a word andbegmodeword
is defined but noendmodeword
(seebegmode
,begmodeword
andendmodeword
)capsletter
is an alias formodeletter uppercase
. The following two examples are equivalent:capsletter 6
modeletter uppercase 6
emphletter
(seeemphletter
) is the counterpart ofmodeletter
for indication of emphasis.begmodeword attribute dots
¶begcapsword dots
The dot pattern which indicates that a certain mode is entered for the following word or remainder of the current word. The mode is automatically terminated by the first character that is not a letter.
For uppercase mode, you can define a list of characters that can appear within a word in capitals without terminating the block. Do this by using the
capsmodechars
opcode (seecapsmodechars
).Example:
begcapsword 6-6
begemphword
(seebegemphword
) is the counterpart ofbegmodeword
for indication of emphasis.endmodeword attribute dots
¶endcapsword dots
The dot pattern which terminates a mode within a word. It is used in cases where the block is not terminated automatically by a word boundary, a number or punctuation. A common case is when an uppercase block is followed directly by a lowercase letter.
For example:
endcapsword 6-3
endemphword
(seeendemphword
) is the counterpart ofendmodeword
for indication of emphasis.capsmodechars characters
Normally, any character other than a letter will automatically cancel the
begcapsword
indicator. However, by using thecapsmodechars
opcode, you can specify a list of characters that are legal within a capitalized word. In some Braille codes, this might be the case for the hyphen character, ‘-’.Example:
capsmodechars -
begmode attribute dots
¶begcaps dots
The dot pattern which indicates that a mode is entered until it is terminated by a
endmode
indicator. It is used in some Braille codes to mark a whole sentence or several words as capital letters. The block can contain capital letters as well as non-alphabetic characters, punctuation, numbers etc.This is the most general opening mark, i.e. it can be used for opening at any position.
Example:
begcaps 6-6-6
begemph
(seebegemph
) is the counterpart ofbegmode
for indication of emphasis.endmode attribute dots
¶endcaps dots
The dot pattern which terminates a mode.
endcaps 6-3
endemph
(seeendemph
) is the counterpart ofendmode
for indication of emphasis.letsign dots
This indicator is needed in Grade 2 to show that a single letter is not a contraction. It is also used when an abbreviation happens to be a sequence of letters that is the same as a contraction. For example:
letsign 56
noletsign letters
-
The letters in the operand will not be proceeded by a letter sign. More than one
noletsign
opcode can be used. This is equivalent to a single entry containing all the letters. In addition, if a single letter, such as ‘a’ in English, is defined as aword
(seeword
) orlargesign
(seelargesign
), it will be treated as though it had also been specified in anoletsign
entry. noletsignbefore characters
If any of the characters precedes a single letter without a space a letter sign is not used. By default the characters apostrophe (‘'’) and period (‘.’) have this property. Use of a
noletsignbefore
entry cancels the defaults. If more than onenoletsignbefore
entry is used, the characters in all entries are combined.noletsignafter characters
If any of the characters follows a single letter without a space a letter sign is not used. By default the characters apostrophe (‘'’) and period (‘.’) have this property. Use of a
noletsignafter
entry cancels the defaults. If more than onenoletsignafter
entry is used the characters in all entries are combined.nocontractsign dots
-
The dots in this opcode are used to indicate a letter or a sequence of letters that are not a contraction, e.g. ‘CD’ (see
contraction
). The opcode is similar to theletsign
opcode (seeletsign
).Note: This opcode was implemented in Liblouis specifically in order to support Unified English Braille (UEB). It may be used in any table, but may have unpredicted side-effects if used outside the intended context. Use with great care, and test thoroughly.
numsign dots
The translator inserts this indicator before numbers made up of digits defined with the
litdigit
opcode (seelitdigit
) to show that they are a number and not letters or some other symbols. A number is terminated when a space, a letter or any other none-litdigit
opcode (seelitdigit
) character is encountered.You can define characters or strings to be part of a number by using the
midnum
opcode (seemidnum
), thenumericmodechars
opcode (seenumericmodechars
) or themidendnumericmodechars
opcode (seemidendnumericmodechars
).Example:
numsign 3456
nonumsign dots
Usually the end of a number doesn’t need to be indicated as the reader expects the number to end at a space character. However for mixed number word combinations you might want to have an indicator that lets the reader notice the end of the number.
For a word like “123abc” for example the reader expects an indicator between the number “123” and the characters “abc”. This can be achieved using the
nonumsign
.Example:
numsign 56
numericnocontchars characters
-
This opcode specifies the characters that require a
nonumsign
opcode (seenonumsign
) if they appear after a number with no intervening space, e.g. ‘1a’ or ‘2-B’.These characters will typically be the letters a-j, which usually constitute the literary digits (see
litdigit
opcode (seelitdigit
)). However, in some Braille codes, all letters fall in this category.Note: This opcode is case sensitive. So, if you need a
nonumsign
opcode (seenonumsign
) to also appear before the capital letters a-j, you should include these letters in the definition. This is especially relevant if you are also using thebegcaps
andendcaps
opcodes (seebegcaps
andendcaps
). In this case, you might otherwise end up having numbers immediately followed by capital letters with no indicator between.Note: This opcode was implemented in Liblouis specifically in order to support Unified English Braille (UEB). It may be used in any table, but may have unpredicted side-effects if used outside the intended context. Use with great care, and test thoroughly.
Example:
numericnocontchars abcdefghij
numericmodechars characters
midendnumericmodechars characters
-
Any of these characters can appear within a number without terminating the effect of the number sign (see
numsign
). In other words, they don’t cancel numeric mode.The difference between the two opcodes is that
numericmodechars
opcode (seenumericmodechars
) characters can appear anywhere in a number whereasmidendnumericmodechars
opcode (seemidendnumericmodechars
) characters can appear only in the middle or at the end of a number. Likemidendnumericmodechars
,numericmodechars
characters keep numeric mode active, but in addition they activate numeric mode immediately when at least one digit follows, and the number sign will precede thenumericmodechars
character in this case.Note: This opcode was implemented in Liblouis specifically in order to support Unified English Braille (UEB). It may be used in any table, but may have unpredicted side-effects if used outside the intended context. Use with great care, and test thoroughly.
Example:
numericmodechars ., midendnumericmodechars -/