org.apache.fop.complexscripts.fonts

## Class GlyphSubstitutionTable

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

-     public class GlyphSubstitutionTable
      extends GlyphTable

  The `GlyphSubstitutionTable` class is a glyph table that implements `GlyphSubstitution` functionality.

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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `GlyphSubstitutionTable.Ligature` The `Ligature` class implements a ligature lookup result in terms of a ligature glyph (code) and the N+1...
    `static class` | `GlyphSubstitutionTable.LigatureSet` The `LigatureSet` class implements a set of ligatures.

    - ### Nested classes/interfaces inherited from class org.apache.fop.complexscripts.fonts.GlyphTable

      `GlyphTable.ChainedClassSequenceRule, GlyphTable.ChainedCoverageSequenceRule, GlyphTable.ChainedGlyphSequenceRule, GlyphTable.ClassSequenceRule, GlyphTable.CoverageSequenceRule, GlyphTable.GlyphSequenceRule, GlyphTable.HomogeneousRuleSet, GlyphTable.LookupSpec, GlyphTable.LookupTable, GlyphTable.Rule, GlyphTable.RuleLookup, GlyphTable.RuleSet, GlyphTable.UseSpec`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `GSUB_LOOKUP_TYPE_ALTERNATE` alternate substitution subtable type
    `static int` | `GSUB_LOOKUP_TYPE_CHAINED_CONTEXTUAL` chained contextual substitution subtable type
    `static int` | `GSUB_LOOKUP_TYPE_CONTEXTUAL` contextual substitution subtable type
    `static int` | `GSUB_LOOKUP_TYPE_EXTENSION_SUBSTITUTION` extension substitution substitution subtable type
    `static int` | `GSUB_LOOKUP_TYPE_LIGATURE` ligature substitution subtable type
    `static int` | `GSUB_LOOKUP_TYPE_MULTIPLE` multiple substitution subtable type
    `static int` | `GSUB_LOOKUP_TYPE_REVERSE_CHAINED_SINGLE` reverse chained contextual single substitution subtable type
    `static int` | `GSUB_LOOKUP_TYPE_SINGLE` single substitution subtable type

    - ### Fields inherited from class org.apache.fop.complexscripts.fonts.GlyphTable

      `GLYPH_TABLE_TYPE_BASELINE, GLYPH_TABLE_TYPE_DEFINITION, GLYPH_TABLE_TYPE_JUSTIFICATION, GLYPH_TABLE_TYPE_POSITIONING, GLYPH_TABLE_TYPE_SUBSTITUTION, processors`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GlyphSubstitutionTable(GlyphDefinitionTable gdef, java.util.Map lookups, java.util.List subtables, java.util.Map<java.lang.String,ScriptProcessor> processors)` Instantiate a `GlyphSubstitutionTable` object using the specified lookups and subtables.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static GlyphSubtable` | `createSubtable(int type, java.lang.String id, int sequence, int flags, int format, GlyphCoverageTable coverage, java.util.List entries)` Create a substitution subtable according to the specified arguments.
    `static GlyphSubtable` | `createSubtable(int type, java.lang.String id, int sequence, int flags, int format, java.util.List coverage, java.util.List entries)` Create a substitution subtable according to the specified arguments.
    `static int` | `getLookupTypeFromName(java.lang.String name)` Map a lookup type name to its constant (integer) value.
    `static java.lang.String` | `getLookupTypeName(int type)` Map a lookup type constant (integer) value to its name.
    `java.lang.CharSequence` | `preProcess(java.lang.CharSequence charSequence, java.lang.String script, MultiByteFont font, java.util.List associations)`
    `GlyphSequence` | `substitute(GlyphSequence gs, java.lang.String script, java.lang.String language)` Perform substitution processing using all matching lookups.

    - ### Methods inherited from class org.apache.fop.complexscripts.fonts.GlyphTable

      `addSubtable, assembleLookups, findLookupTables, freezeSubtables, getGlyphDefinitions, getLookups, getLookupTable, getLookupTables, getTableTypeFromName, hasFeature, matchLookups, matchLookupSpecs, resolveLookupReferences, toString`

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

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

- - ### Field Detail

    - #### GSUB_LOOKUP_TYPE_SINGLE

          public static final int GSUB_LOOKUP_TYPE_SINGLE

      single substitution subtable type
      See Also:
        Constant Field Values

    - #### GSUB_LOOKUP_TYPE_MULTIPLE

          public static final int GSUB_LOOKUP_TYPE_MULTIPLE

      multiple substitution subtable type
      See Also:
        Constant Field Values

    - #### GSUB_LOOKUP_TYPE_ALTERNATE

          public static final int GSUB_LOOKUP_TYPE_ALTERNATE

      alternate substitution subtable type
      See Also:
        Constant Field Values

    - #### GSUB_LOOKUP_TYPE_LIGATURE

          public static final int GSUB_LOOKUP_TYPE_LIGATURE

      ligature substitution subtable type
      See Also:
        Constant Field Values

    - #### GSUB_LOOKUP_TYPE_CONTEXTUAL

          public static final int GSUB_LOOKUP_TYPE_CONTEXTUAL

      contextual substitution subtable type
      See Also:
        Constant Field Values

    - #### GSUB_LOOKUP_TYPE_CHAINED_CONTEXTUAL

          public static final int GSUB_LOOKUP_TYPE_CHAINED_CONTEXTUAL

      chained contextual substitution subtable type
      See Also:
        Constant Field Values

    - #### GSUB_LOOKUP_TYPE_EXTENSION_SUBSTITUTION

          public static final int GSUB_LOOKUP_TYPE_EXTENSION_SUBSTITUTION

      extension substitution substitution subtable type
      See Also:
        Constant Field Values

    - #### GSUB_LOOKUP_TYPE_REVERSE_CHAINED_SINGLE

          public static final int GSUB_LOOKUP_TYPE_REVERSE_CHAINED_SINGLE

      reverse chained contextual single substitution subtable type
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### GlyphSubstitutionTable

          public GlyphSubstitutionTable(GlyphDefinitionTable gdef,
                                java.util.Map lookups,
                                java.util.List subtables,
                                java.util.Map<java.lang.String,ScriptProcessor> processors)

      Instantiate a `GlyphSubstitutionTable` object using the specified lookups and subtables.
      Parameters:
        `gdef` - glyph definition table that applies
        `lookups` - a map of lookup specifications to subtable identifier strings
        `subtables` - a list of identified subtables

  - ### Method Detail

    - #### substitute

          public GlyphSequence substitute(GlyphSequence gs,
                                 java.lang.String script,
                                 java.lang.String language)

      Perform substitution processing using all matching lookups.
      Parameters:
        `gs` - an input glyph sequence
        `script` - a script identifier
        `language` - a language identifier
      Returns:
        the substituted (output) glyph sequence

    - #### preProcess

          public java.lang.CharSequence preProcess(java.lang.CharSequence charSequence,
                                          java.lang.String script,
                                          MultiByteFont font,
                                          java.util.List associations)

    - #### getLookupTypeFromName

          public static int getLookupTypeFromName(java.lang.String name)

      Map a lookup type name to its constant (integer) value.
      Parameters:
        `name` - lookup type name
      Returns:
        lookup type

    - #### getLookupTypeName

          public static java.lang.String getLookupTypeName(int type)

      Map a lookup type constant (integer) value to its name.
      Parameters:
        `type` - lookup type
      Returns:
        lookup type name

    - #### createSubtable

          public static GlyphSubtable createSubtable(int type,
                                     java.lang.String id,
                                     int sequence,
                                     int flags,
                                     int format,
                                     GlyphCoverageTable coverage,
                                     java.util.List entries)

      Create a substitution subtable according to the specified arguments.
      Parameters:
        `type` - subtable type
        `id` - subtable identifier
        `sequence` - subtable sequence
        `flags` - subtable flags
        `format` - subtable format
        `coverage` - subtable coverage table
        `entries` - subtable entries
      Returns:
        a glyph subtable instance

    - #### createSubtable

          public static GlyphSubtable createSubtable(int type,
                                     java.lang.String id,
                                     int sequence,
                                     int flags,
                                     int format,
                                     java.util.List coverage,
                                     java.util.List entries)

      Create a substitution subtable according to the specified arguments.
      Parameters:
        `type` - subtable type
        `id` - subtable identifier
        `sequence` - subtable sequence
        `flags` - subtable flags
        `format` - subtable format
        `coverage` - list of coverage table entries
        `entries` - subtable entries
      Returns:
        a glyph subtable instance

Copyright 1999-2019 The Apache Software Foundation. All Rights Reserved.