org.apache.fop.complexscripts.fonts

## Class GlyphTable.LookupTable

- java.lang.Object
- - org.apache.fop.complexscripts.fonts.GlyphTable.LookupTable

- All Implemented Interfaces:
    Comparable
  Enclosing class:
    GlyphTable

      public static class GlyphTable.LookupTable
      extends Object
      implements Comparable

  The `LookupTable` class comprising an identifier and an ordered list of glyph subtables, each of which employ the same lookup identifier.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LookupTable(String id, GlyphSubtable subtable)` Instantiate a LookupTable.
    `LookupTable(String id, List<GlyphSubtable> subtables)` Instantiate a LookupTable.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addSubtable(GlyphSubtable subtable)` Add a subtable into this lookup table's collecion of subtables according to its natural order.
    `int` | `compareTo(Object o)`
    `boolean` | `equals(Object o)`
    `void` | `freezeSubtables(Map<String,GlyphTable.LookupTable> lookupTables)` Freeze subtables, i.e., do not allow further subtable addition, and create resulting cached state.
    `GlyphSubtable[]` | `getSubtables()`
    `int` | `hashCode()`
    `boolean` | `performsPositioning()` Determine if this glyph table performs positioning.
    `boolean` | `performsSubstitution()` Determine if this glyph table performs substitution.
    `boolean` | `position(GlyphPositioningState ps, int sequenceIndex)` Perform positioning processing on an existing glyph positioning state object using this lookup table's subtables.
    `boolean` | `position(GlyphSequence gs, String script, String language, String feature, int fontSize, int[] widths, int[][] adjustments, ScriptContextTester sct)` Perform positioning processing using this lookup table's subtables.
    `GlyphSequence` | `substitute(GlyphSequence gs, String script, String language, String feature, ScriptContextTester sct)` Perform substitution processing using this lookup table's subtables.
    `GlyphSequence` | `substitute(GlyphSubstitutionState ss, int sequenceIndex)` Perform substitution processing on an existing glyph substitution state object using this lookup table's subtables.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### LookupTable

          public LookupTable(String id,
                             GlyphSubtable subtable)

      Instantiate a LookupTable.
      Parameters:
        `id` - the lookup table's identifier
        `subtable` - an initial subtable (or null)

    - #### LookupTable

          public LookupTable(String id,
                             List<GlyphSubtable> subtables)

      Instantiate a LookupTable.
      Parameters:
        `id` - the lookup table's identifier
        `subtables` - a pre-poplated list of subtables or null

  - ### Method Detail

    - #### getSubtables

          public GlyphSubtable[] getSubtables()

      Returns:
        the subtables as an array

    - #### addSubtable

          public boolean addSubtable(GlyphSubtable subtable)

      Add a subtable into this lookup table's collecion of subtables according to its natural order.
      Parameters:
        `subtable` - to add
      Returns:
        true if subtable was not already present, otherwise false

    - #### freezeSubtables

          public void freezeSubtables(Map<String,GlyphTable.LookupTable> lookupTables)

      Freeze subtables, i.e., do not allow further subtable addition, and create resulting cached state. In addition, resolve any references to lookup tables that appear in this lookup table's subtables.
      Parameters:
        `lookupTables` - map from lookup table identifers, e.g. "lu4", to lookup tables

    - #### performsSubstitution

          public boolean performsSubstitution()

      Determine if this glyph table performs substitution.
      Returns:
        true if it performs substitution

    - #### substitute

          public GlyphSequence substitute(GlyphSequence gs,
                                          String script,
                                          String language,
                                          String feature,
                                          ScriptContextTester sct)

      Perform substitution processing using this lookup table's subtables.
      Parameters:
        `gs` - an input glyph sequence
        `script` - a script identifier
        `language` - a language identifier
        `feature` - a feature identifier
        `sct` - a script specific context tester (or null)
      Returns:
        the substituted (output) glyph sequence

    - #### substitute

          public GlyphSequence substitute(GlyphSubstitutionState ss,
                                          int sequenceIndex)

      Perform substitution processing on an existing glyph substitution state object using this lookup table's subtables.
      Parameters:
        `ss` - a glyph substitution state object
        `sequenceIndex` - if non negative, then apply subtables only at specified sequence index
      Returns:
        the substituted (output) glyph sequence

    - #### performsPositioning

          public boolean performsPositioning()

      Determine if this glyph table performs positioning.
      Returns:
        true if it performs positioning

    - #### position

          public boolean position(GlyphSequence gs,
                                  String script,
                                  String language,
                                  String feature,
                                  int fontSize,
                                  int[] widths,
                                  int[][] adjustments,
                                  ScriptContextTester sct)

      Perform positioning processing using this lookup table's subtables.
      Parameters:
        `gs` - an input glyph sequence
        `script` - a script identifier
        `language` - a language identifier
        `feature` - a feature identifier
        `fontSize` - size in device units
        `widths` - array of default advancements for each glyph in font
        `adjustments` - accumulated adjustments array (sequence) of 4-tuples of placement [PX,PY] and advance [AX,AY] adjustments, in that order, with one 4-tuple for each element of glyph sequence
        `sct` - a script specific context tester (or null)
      Returns:
        true if some adjustment is not zero; otherwise, false

    - #### position

          public boolean position(GlyphPositioningState ps,
                                  int sequenceIndex)

      Perform positioning processing on an existing glyph positioning state object using this lookup table's subtables.
      Parameters:
        `ps` - a glyph positioning state object
        `sequenceIndex` - if non negative, then apply subtables only at specified sequence index
      Returns:
        true if some adjustment is not zero; otherwise, false

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`
      Returns:
        true if identifier of the specified lookup table is the same as the identifier of this lookup table

    - #### compareTo

          public int compareTo(Object o)

      Specified by:
        `compareTo` in interface `Comparable`
      Returns:
        the result of comparing the identifier of the specified lookup table with the identifier of this lookup table; lookup table identifiers take the form "lu(DIGIT)+", with comparison based on numerical ordering of numbers expressed by (DIGIT)+.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2023 Apache Software Foundation. All rights reserved.