org.apache.fop.complexscripts.fonts

## Class GlyphSubtable

- java.lang.Object
- - org.apache.fop.complexscripts.fonts.GlyphSubtable

- All Implemented Interfaces:
    java.lang.Comparable
  Direct Known Subclasses:
    GlyphDefinitionSubtable, GlyphPositioningSubtable, GlyphSubstitutionSubtable

      public abstract class GlyphSubtable
      extends java.lang.Object
      implements java.lang.Comparable

  The `GlyphSubtable` implements an abstract glyph subtable that encapsulates identification, type, format, and coverage information.

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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `LF_IGNORE_BASE` lookup flag - ignore base glyphs
    `static int` | `LF_IGNORE_LIGATURE` lookup flag - ignore ligatures
    `static int` | `LF_IGNORE_MARK` lookup flag - ignore marks
    `static int` | `LF_INTERNAL_USE_REVERSE_SCAN` internal flag - use reverse scan
    `static int` | `LF_MARK_ATTACHMENT_TYPE` lookup flag - mark attachment type
    `static int` | `LF_RESERVED` lookup flag - reserved
    `static int` | `LF_RIGHT_TO_LEFT` lookup flag - right to left
    `static int` | `LF_USE_MARK_FILTERING_SET` lookup flag - use mark filtering set

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `GlyphSubtable(java.lang.String lookupId, int sequence, int flags, int format, GlyphMappingTable mapping)` Instantiate this glyph subtable.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(java.lang.Object o)`
    `boolean` | `equals(java.lang.Object o)`
    `GlyphClassMapping` | `getClasses()`
    `GlyphCoverageMapping` | `getCoverage()`
    `int` | `getCoverageIndex(int gid)` Map glyph id to coverage index.
    `int` | `getCoverageSize()` Map glyph id to coverage index.
    `abstract java.util.List` | `getEntries()`
    `int` | `getFlags()`
    `static int` | `getFlags(GlyphSubtable[] subtables)` Determine consistent flags for a set of subtables.
    `int` | `getFormat()`
    `GlyphDefinitionTable` | `getGDEF()`
    `java.lang.String` | `getLookupId()`
    `int` | `getSequence()`
    `GlyphTable` | `getTable()`
    `abstract int` | `getTableType()`
    `abstract int` | `getType()`
    `abstract java.lang.String` | `getTypeName()`
    `int` | `hashCode()`
    `abstract boolean` | `isCompatible(GlyphSubtable subtable)` Determine if a glyph subtable is compatible with this glyph subtable.
    `void` | `resolveLookupReferences(java.util.Map<java.lang.String,GlyphTable.LookupTable> lookupTables)` Resolve references to lookup tables, e.g., in RuleLookup, to the lookup tables themselves.
    `void` | `setTable(GlyphTable table)` Establish a weak reference from this subtable to its parent table.
    `abstract boolean` | `usesReverseScan()`
    `static boolean` | `usesReverseScan(GlyphSubtable[] subtables)` Determine if any of the specified subtables uses reverse scanning.

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

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

- - ### Field Detail

    - #### LF_RIGHT_TO_LEFT

          public static final int LF_RIGHT_TO_LEFT

      lookup flag - right to left
      See Also:
        Constant Field Values

    - #### LF_IGNORE_BASE

          public static final int LF_IGNORE_BASE

      lookup flag - ignore base glyphs
      See Also:
        Constant Field Values

    - #### LF_IGNORE_LIGATURE

          public static final int LF_IGNORE_LIGATURE

      lookup flag - ignore ligatures
      See Also:
        Constant Field Values

    - #### LF_IGNORE_MARK

          public static final int LF_IGNORE_MARK

      lookup flag - ignore marks
      See Also:
        Constant Field Values

    - #### LF_USE_MARK_FILTERING_SET

          public static final int LF_USE_MARK_FILTERING_SET

      lookup flag - use mark filtering set
      See Also:
        Constant Field Values

    - #### LF_RESERVED

          public static final int LF_RESERVED

      lookup flag - reserved
      See Also:
        Constant Field Values

    - #### LF_MARK_ATTACHMENT_TYPE

          public static final int LF_MARK_ATTACHMENT_TYPE

      lookup flag - mark attachment type
      See Also:
        Constant Field Values

    - #### LF_INTERNAL_USE_REVERSE_SCAN

          public static final int LF_INTERNAL_USE_REVERSE_SCAN

      internal flag - use reverse scan
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### GlyphSubtable

          protected GlyphSubtable(java.lang.String lookupId,
                                  int sequence,
                                  int flags,
                                  int format,
                                  GlyphMappingTable mapping)

      Instantiate this glyph subtable.
      Parameters:
        `lookupId` - lookup identifier, having form of "lu%d" where %d is index of lookup in lookup list
        `sequence` - subtable sequence (within lookup), starting with zero
        `flags` - subtable flags
        `format` - subtable format
        `mapping` - subtable mapping table

  - ### Method Detail

    - #### getLookupId

          public java.lang.String getLookupId()

      Returns:
        this subtable's lookup identifer

    - #### getTableType

          public abstract int getTableType()

      Returns:
        this subtable's table type

    - #### getType

          public abstract int getType()

      Returns:
        this subtable's type

    - #### getTypeName

          public abstract java.lang.String getTypeName()

      Returns:
        this subtable's type name

    - #### isCompatible

          public abstract boolean isCompatible(GlyphSubtable subtable)

      Determine if a glyph subtable is compatible with this glyph subtable. Two glyph subtables are compatible if the both may appear in a single lookup table.
      Parameters:
        `subtable` - a glyph subtable to determine compatibility
      Returns:
        true if specified subtable is compatible with this glyph subtable, where by compatible is meant that they share the same lookup type

    - #### usesReverseScan

          public abstract boolean usesReverseScan()

      Returns:
        true if subtable uses reverse scanning of glyph sequence, meaning from the last glyph in a glyph sequence to the first glyph

    - #### getSequence

          public int getSequence()

      Returns:
        this subtable's sequence (index) within lookup

    - #### getFlags

          public int getFlags()

      Returns:
        this subtable's flags

    - #### getFormat

          public int getFormat()

      Returns:
        this subtable's format

    - #### getGDEF

          public GlyphDefinitionTable getGDEF()

      Returns:
        this subtable's governing glyph definition table or null if none available

    - #### getCoverage

          public GlyphCoverageMapping getCoverage()

      Returns:
        this subtable's coverage mapping or null if mapping is not a coverage mapping

    - #### getClasses

          public GlyphClassMapping getClasses()

      Returns:
        this subtable's class mapping or null if mapping is not a class mapping

    - #### getEntries

          public abstract java.util.List getEntries()

      Returns:
        this subtable's lookup entries

    - #### getTable

          public GlyphTable getTable()

      Returns:
        this subtable's parent table (or null if undefined)

    - #### setTable

          public void setTable(GlyphTable table)
                        throws java.lang.IllegalStateException

      Establish a weak reference from this subtable to its parent table. If table parameter is specified as `null`, then clear and remove weak reference.
      Parameters:
        `table` - the table or null
      Throws:
        `java.lang.IllegalStateException` - if table is already set to non-null

    - #### resolveLookupReferences

          public void resolveLookupReferences(java.util.Map<java.lang.String,GlyphTable.LookupTable> lookupTables)

      Resolve references to lookup tables, e.g., in RuleLookup, to the lookup tables themselves.
      Parameters:
        `lookupTables` - map from lookup table identifers, e.g. "lu4", to lookup tables

    - #### getCoverageIndex

          public int getCoverageIndex(int gid)

      Map glyph id to coverage index.
      Parameters:
        `gid` - glyph id
      Returns:
        the corresponding coverage index of the specified glyph id

    - #### getCoverageSize

          public int getCoverageSize()

      Map glyph id to coverage index.
      Returns:
        the corresponding coverage index of the specified glyph id

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`
      Returns:
        true if the lookup identifier and the sequence number of the specified subtable is the same as the lookup identifier and sequence number of this subtable

    - #### compareTo

          public int compareTo(java.lang.Object o)

      Specified by:
        `compareTo` in interface `java.lang.Comparable`
      Returns:
        the result of comparing the lookup identifier and the sequence number of the specified subtable with the lookup identifier and sequence number of this subtable

    - #### usesReverseScan

          public static boolean usesReverseScan(GlyphSubtable[] subtables)

      Determine if any of the specified subtables uses reverse scanning.
      Parameters:
        `subtables` - array of glyph subtables
      Returns:
        true if any of the specified subtables uses reverse scanning.

    - #### getFlags

          public static int getFlags(GlyphSubtable[] subtables)
                              throws java.lang.IllegalStateException

      Determine consistent flags for a set of subtables.
      Parameters:
        `subtables` - array of glyph subtables
      Returns:
        consistent flags
      Throws:
        `java.lang.IllegalStateException` - if inconsistent flags

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