org.apache.fop.complexscripts.fonts

## Class GlyphPositioningTable

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

-     public class GlyphPositioningTable
      extends GlyphTable

  The `GlyphPositioningTable` class is a glyph table that implements `GlyphPositioning` 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` | `GlyphPositioningTable.Anchor` The `Anchor` class implements a anchor record, comprising an X,Y coordinate pair, an optional anchor point index (or -1), and optional X or Y device tables (or null if absent).
    `static class` | `GlyphPositioningTable.DeviceTable` The `DeviceTable` class implements a positioning device table record, comprising adjustments to be made to scaled design units according to the scaled size.
    `static class` | `GlyphPositioningTable.MarkAnchor` The `MarkAnchor` class is a subclass of the `Anchor` class, adding a mark class designation.
    `static class` | `GlyphPositioningTable.PairValues` The `PairValues` class implements a pair value record, comprising a glyph id (or zero) and two optional positioning values.
    `static class` | `GlyphPositioningTable.Value` The `Value` class implements a positioning value record, comprising placement and advancement information in X and Y axes, and optionally including device data used to perform device (grid-fitted) specific fine grain adjustments.

    - ### 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` | `GPOS_LOOKUP_TYPE_CHAINED_CONTEXTUAL` chained contextual positioning subtable type
    `static int` | `GPOS_LOOKUP_TYPE_CONTEXTUAL` contextual positioning subtable type
    `static int` | `GPOS_LOOKUP_TYPE_CURSIVE` cursive positioning subtable type
    `static int` | `GPOS_LOOKUP_TYPE_EXTENSION_POSITIONING` extension positioning subtable type
    `static int` | `GPOS_LOOKUP_TYPE_MARK_TO_BASE` mark to base positioning subtable type
    `static int` | `GPOS_LOOKUP_TYPE_MARK_TO_LIGATURE` mark to ligature positioning subtable type
    `static int` | `GPOS_LOOKUP_TYPE_MARK_TO_MARK` mark to mark positioning subtable type
    `static int` | `GPOS_LOOKUP_TYPE_PAIR` multiple positioning subtable type
    `static int` | `GPOS_LOOKUP_TYPE_SINGLE` single positioning 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
    `GlyphPositioningTable(GlyphDefinitionTable gdef, java.util.Map lookups, java.util.List subtables, java.util.Map<java.lang.String,ScriptProcessor> processors)` Instantiate a `GlyphPositioningTable` object using the specified lookups and subtables.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete 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 positioning 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 positioning 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.
    `boolean` | `position(GlyphSequence gs, java.lang.String script, java.lang.String language, int fontSize, int[] widths, int[][] adjustments)` Perform positioning 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

    - #### GPOS_LOOKUP_TYPE_SINGLE

          public static final int GPOS_LOOKUP_TYPE_SINGLE

      single positioning subtable type
      See Also:
        Constant Field Values

    - #### GPOS_LOOKUP_TYPE_PAIR

          public static final int GPOS_LOOKUP_TYPE_PAIR

      multiple positioning subtable type
      See Also:
        Constant Field Values

    - #### GPOS_LOOKUP_TYPE_CURSIVE

          public static final int GPOS_LOOKUP_TYPE_CURSIVE

      cursive positioning subtable type
      See Also:
        Constant Field Values

    - #### GPOS_LOOKUP_TYPE_MARK_TO_BASE

          public static final int GPOS_LOOKUP_TYPE_MARK_TO_BASE

      mark to base positioning subtable type
      See Also:
        Constant Field Values

    - #### GPOS_LOOKUP_TYPE_MARK_TO_LIGATURE

          public static final int GPOS_LOOKUP_TYPE_MARK_TO_LIGATURE

      mark to ligature positioning subtable type
      See Also:
        Constant Field Values

    - #### GPOS_LOOKUP_TYPE_MARK_TO_MARK

          public static final int GPOS_LOOKUP_TYPE_MARK_TO_MARK

      mark to mark positioning subtable type
      See Also:
        Constant Field Values

    - #### GPOS_LOOKUP_TYPE_CONTEXTUAL

          public static final int GPOS_LOOKUP_TYPE_CONTEXTUAL

      contextual positioning subtable type
      See Also:
        Constant Field Values

    - #### GPOS_LOOKUP_TYPE_CHAINED_CONTEXTUAL

          public static final int GPOS_LOOKUP_TYPE_CHAINED_CONTEXTUAL

      chained contextual positioning subtable type
      See Also:
        Constant Field Values

    - #### GPOS_LOOKUP_TYPE_EXTENSION_POSITIONING

          public static final int GPOS_LOOKUP_TYPE_EXTENSION_POSITIONING

      extension positioning subtable type
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### GlyphPositioningTable

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

      Instantiate a `GlyphPositioningTable` 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

    - #### 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 positioning 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 positioning 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

    - #### position

          public boolean position(GlyphSequence gs,
                                  java.lang.String script,
                                  java.lang.String language,
                                  int fontSize,
                                  int[] widths,
                                  int[][] adjustments)

      Perform positioning processing using all matching lookups.
      Parameters:
        `gs` - an input glyph sequence
        `script` - a script identifier
        `language` - a language identifier
        `fontSize` - size in device units
        `widths` - array of default advancements for each glyph
        `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
      Returns:
        true if some adjustment is not zero; otherwise, false

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