liblouis: Emphasis Opcodes

1 
1 2.5 Emphasis Opcodes
1 ====================
1 
1 These also define braille indicators, but they require more explanation.
1 There are four sets, for italic, bold, underline and computer braille.
1 In each of the first three sets there are seven opcodes, for use before
1 the first word of a phrase, for use before the last word, for use after
1 the last word, for use before the first letter (or character) if
1 emphasis starts in the middle of a word, for use after the last letter
1 (or character) if emphasis ends in the middle of a word, before a single
1 letter (or character), and to specify the length of a phrase to which
1 the first-word and last-word-before indicators apply.  This rather
1 elaborate set of emphasis opcodes was devised to try to meet all
1 contingencies.  It is unlikely that a translation table will contain all
1 of them.  The translator checks for their presence.  If they are
1 present, it first looks to see if the single-letter indicator should be
1 used.  Then it looks at the word (or phrase) indicators and finally at
1 the multi-letter indicators.
1 
1    The translator will apply up to two emphasis indicators to each
1 phrase or string of characters, depending on what the 'typeform'
11 parameter in its calling sequence indicates (⇒Programming with
 liblouis).
1 
1    For computer braille there are only two braille indicators, for the
1 beginning and end of a sequence of characters to be rendered in computer
1 braille.  Such a sequence may also have other emphasis.  The computer
1 braille indicators are applied not only when computer braille is
1 indicated in the 'typeform' parameter, but also when a sequence of
1 characters is determined to be computer braille because it contains a
11 subsequence defined by the 'compbrl' opcode (⇒compbrl compbrl
 opcode.) or the 'literal' opcode (⇒literal literal opcode.).
1 
1    Here are the various emphasis opcodes.
1 
1 'firstwordital dots'
1      This is the braille indicator to be placed before the first word of
1      an italicized phrase that is longer than the value given in the
11      'lenitalphrase' opcode (⇒lenitalphrase lenitalphrase
      opcode.).  For example:
1 
1           firstwordital 46-46 English indicator
1 
1 'lastworditalbefore dots'
1      This is the braille indicator to be placed before the last word of
1      an italicized phrase.  In addition, if 'firstwordital' is not used,
1      this braille indicator is doubled and placed before the first word.
1      Do not use 'lastworditalbefore' and 'lastworditalafter' in the same
1      table.  For example:
1 
1           lastworditalbefore 4-6
1 
1 'lastworditalafter dots'
1      This is the braille indicator to be placed after the last word of
1      an italicized phrase.  Do not use 'lastworditalbefore' and
1      'lastworditalafter' in the same table.  See also the
1      'lenitalphrase' opcode (⇒lenitalphrase lenitalphrase opcode.)
1      for more information.
1 
1 'firstletterital dots'
1      This is the braille indicator to be placed before the first letter
1      (or character) if italicization begins in the middle of a word.
1 
1 'lastletterital dots'
1      This is the braille indicator to be placed after the last letter
1      (or character) when italicization ends in the middle of a word.
1 
1 'singleletterital dots'
1      This braille indicator is used if only a single letter (or
1      character) is italicized.
1 
1 'lenitalphrase number'
1      If 'lastworditalbefore' is used, an italicized phrase is checked to
1      see how many words it contains.  If this number is less than or
1      equal to the number given in the 'lenitalphrase' opcode, the
1      'lastworditalbefore' sign is placed in front of each word.  If it
1      is greater, the 'firstwordital' indicator is placed before the
1      first word and the 'lastworditalbefore' indicator is placed after
1      the last word.  Note that if the 'firstwordital' opcode is not used
1      its indicator is made up by doubling the dot pattern given in the
1      'lastworditalbefore' entry.  For example:
1 
1           lenitalphrase 4
1 
1 'firstwordbold dots'
1      This is the braille indicator to be placed before the first word of
1      a bold phrase.  For example:
1 
1           firstwordbold 456-456
1 
1 'lastwordboldbefore dots'
1      This is the braille indicator to be placed before the last word of
1      a bold phrase.  In addition, if 'firstwordbold' is not used, this
1      braille indicator is doubled and placed before the first word.  Do
1      not use 'lastwordboldbefore' and 'lastwordboldafter' in the same
1      table.  For example:
1 
1           lastwordboldbefore 456
1 
1 'lastwordboldafter dots'
1      This is the braille indicator to be placed after the last word of a
1      bold phrase.  Do not use 'lastwordboldbefore' and
1      'lastwordboldafter' in the same table.
1 
1 'firstletterbold dots'
1      This is the braille indicator to be placed before the first letter
1      (or character) if bold emphasis begins in the middle of a word.
1 
1 'lastletterbold dots'
1      This is the braille indicator to be placed after the last letter
1      (or character) when bold emphasis ends in the middle of a word.
1 
1 'singleletterbold dots'
1      This braille indicator is used if only a single letter (or
1      character) is in boldface.
1 
1 'lenboldphrase number'
1      If 'lastwordboldbefore' is used, a bold phrase is checked to see
1      how many words it contains.  If this number is less than or equal
1      to the number given in the 'lenboldphrase' opcode, the
1      'lastwordboldbefore' sign is placed in front of each word.  If it
1      is greater, the 'firstwordbold' indicator is placed before the
1      first word and the 'lastwordboldbefore' indicator is placed after
1      the last word.  Note that if the 'firstwordbold' opcode is not used
1      its indicator is made up by doubling the dot pattern given in the
1      'lastwordboldbefore' entry.
1 
1 'firstwordunder dots'
1      This is the braille indicator to be placed before the first word of
1      an underlined phrase.
1 
1 'lastwordunderbefore dots'
1      This is the braille indicator to be placed before the last word of
1      an underlined phrase.  In addition, if 'firstwordunder' is not
1      used, this braille indicator is doubled and placed before the first
1      word.
1 
1 'lastwordunderafter dots'
1      This is the braille indicator to be placed after the last word of
1      an underlined phrase.
1 
1 'firstletterunder dots'
1      This is the braille indicator to be placed before the first letter
1      (or character) if underline emphasis begins in the middle of a
1      word.
1 
1 'lastletterunder dots'
1      This is the braille indicator to be placed after the last letter
1      (or character) when underline emphasis ends in the middle of a
1      word.
1 
1 'singleletterunder dots'
1      This braille indicator is used if only a single letter (or
1      character) is underlined.
1 
1 'lenunderphrase number'
1      If 'lastwordunderbefore' is used, an underlined phrase is checked
1      to see how many words it contains.  If this number is less than or
1      equal to the number given in the 'lenunderphrase' opcode, the
1      'lastwordunderbefore' sign is placed in front of each word.  If it
1      is greater, the 'firstwordunder' indicator is placed before the
1      first word and the 'lastwordunderbefore' indicator is placed after
1      the last word.  Note that if the 'firstwordunder' opcode is not
1      used its indicator is made up by doubling the dot pattern given in
1      the 'lastwordunderbefore' entry.
1 
1 'begcomp dots'
1      This braille indicator is placed before a sequence of characters
1      translated in computer braille, whether this sequence is indicated
1      in the 'typeform' parameter (⇒Programming with liblouis) or
1      inferred because it contains a subsequence specified by the
1      'compbrl' opcode (⇒compbrl compbrl opcode.).
1 
1 'endcomp dots'
1      This braille indicator is placed after a sequence of characters
1      translated in computer braille, whether this sequence is indicated
1      in the 'typeform' parameter (⇒Programming with liblouis) or
1      inferred because it contains a subsequence specified by the
1      'compbrl' opcode (⇒compbrl compbrl opcode.).
1