org.apache.fop.complexscripts.fonts

## Interface Substitutable

- All Known Implementing Classes:
    CFFToType1Font, CustomFontMetricsMapper, Font, LazyFont, MultiByteFont

      public interface Substitutable

  Optional interface which indicates that glyph substitution is supported and, if supported, can perform substitution.

  This work was originally authored by Glenn Adams (gadams@apache.org).

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `performsSubstitution()` Determines if font performs glyph substitution.
    `CharSequence` | `performSubstitution(CharSequence cs, String script, String language, List associations, boolean retainControls)` Perform substitutions on characters to effect glyph substitution.
    `CharSequence` | `reorderCombiningMarks(CharSequence cs, int[][] gpa, String script, String language, List associations)` Reorder combining marks in character sequence so that they precede (within the sequence) the base character to which they are applied.

- - ### Method Detail

    - #### performsSubstitution

          boolean performsSubstitution()

      Determines if font performs glyph substitution.
      Returns:
        true if performs substitution.

    - #### performSubstitution

          CharSequence performSubstitution(CharSequence cs,
                                           String script,
                                           String language,
                                           List associations,
                                           boolean retainControls)

      Perform substitutions on characters to effect glyph substitution. If some substitution is performed, it entails mapping from one or more input characters denoting textual character information to one or more output character codes denoting glyphs in this font, where the output character codes may make use of private character code values that have significance only for this font.
      Parameters:
        `cs` - character sequence to map to output font encoding character sequence
        `script` - a script identifier
        `language` - a language identifier
        `associations` - optional list to receive list of character associations
        `retainControls` - if true, then retain control characters and their glyph mappings, otherwise remove
      Returns:
        output sequence (represented as a character sequence, where each character in the returned sequence denotes "font characters", i.e., character codes that map directly (1-1) to their associated glyphs

    - #### reorderCombiningMarks

          CharSequence reorderCombiningMarks(CharSequence cs,
                                             int[][] gpa,
                                             String script,
                                             String language,
                                             List associations)

      Reorder combining marks in character sequence so that they precede (within the sequence) the base character to which they are applied. N.B. In the case of LTR segments, marks are not reordered by this, method since when the segment is reversed by BIDI processing, marks are automatically reordered to precede their base character.
      Parameters:
        `cs` - character sequence within which combining marks to be reordered
        `gpa` - associated glyph position adjustments (also reordered)
        `script` - a script identifier
        `language` - a language identifier
        `associations` - optional list of associations to be reordered
      Returns:
        output sequence containing reordered "font characters"

Copyright © 2023 Apache Software Foundation. All rights reserved.