Class GlyphPositioningSubtable
java.lang.Object
org.apache.fop.complexscripts.fonts.GlyphSubtable
org.apache.fop.complexscripts.fonts.GlyphPositioningSubtable
- All Implemented Interfaces:
Comparable
,GlyphPositioning
- Direct Known Subclasses:
GlyphPositioningTable.ChainedContextualSubtable
,GlyphPositioningTable.ContextualSubtable
,GlyphPositioningTable.CursiveSubtable
,GlyphPositioningTable.MarkToBaseSubtable
,GlyphPositioningTable.MarkToLigatureSubtable
,GlyphPositioningTable.MarkToMarkSubtable
,GlyphPositioningTable.PairSubtable
,GlyphPositioningTable.SingleSubtable
The GlyphPositioningSubtable
implements an abstract base of a glyph subtable,
providing a default implementation of the GlyphPositioning
interface.
This work was originally authored by Glenn Adams (gadams@apache.org).
-
Field Summary
FieldsFields inherited from class org.apache.fop.complexscripts.fonts.GlyphSubtable
LF_IGNORE_BASE, LF_IGNORE_LIGATURE, LF_IGNORE_MARK, LF_INTERNAL_USE_REVERSE_SCAN, LF_MARK_ATTACHMENT_TYPE, LF_RESERVED, LF_RIGHT_TO_LEFT, LF_USE_MARK_FILTERING_SET
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
GlyphPositioningSubtable
(String id, int sequence, int flags, int format, GlyphCoverageTable coverage) Instantiate aGlyphPositioningSubtable
. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
isCompatible
(GlyphSubtable subtable) Determine if a glyph subtable is compatible with this glyph subtable.boolean
Perform glyph positioning at the current index, mutating the positioning state object as required.static final boolean
position
(GlyphPositioningState ps, GlyphPositioningSubtable[] sta, int sequenceIndex) Apply positioning using specified state and subtable array.static final boolean
position
(GlyphSequence gs, String script, String language, String feature, int fontSize, GlyphPositioningSubtable[] sta, int[] widths, int[][] adjustments, ScriptContextTester sct) Apply positioning.boolean
Methods inherited from class org.apache.fop.complexscripts.fonts.GlyphSubtable
compareTo, equals, getClasses, getCoverage, getCoverageIndex, getCoverageSize, getEntries, getFlags, getFlags, getFormat, getGDEF, getLookupId, getSequence, getTable, getType, hashCode, resolveLookupReferences, setTable, usesReverseScan
-
Field Details
-
STATE
-
-
Constructor Details
-
GlyphPositioningSubtable
protected GlyphPositioningSubtable(String id, int sequence, int flags, int format, GlyphCoverageTable coverage) Instantiate aGlyphPositioningSubtable
.- Parameters:
id
- subtable identifiersequence
- subtable sequenceflags
- subtable flagsformat
- subtable formatcoverage
- subtable coverage table
-
-
Method Details
-
getTableType
public int getTableType()- Specified by:
getTableType
in classGlyphSubtable
- Returns:
- this subtable's table type
-
getTypeName
- Specified by:
getTypeName
in classGlyphSubtable
- Returns:
- this subtable's type name
-
isCompatible
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.- Specified by:
isCompatible
in classGlyphSubtable
- 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 boolean usesReverseScan()- Specified by:
usesReverseScan
in classGlyphSubtable
- Returns:
- true if subtable uses reverse scanning of glyph sequence, meaning from the last glyph in a glyph sequence to the first glyph
-
position
Perform glyph positioning at the current index, mutating the positioning state object as required. Only the context associated with the current index is processed.- Specified by:
position
in interfaceGlyphPositioning
- Parameters:
ps
- glyph positioning state object- Returns:
- true if the glyph subtable applies, meaning that the current context matches the associated input context glyph coverage table; note that returning true does not mean any position adjustment occurred; it only means that no further glyph subtables for the current lookup table should be applied.
-
position
public static final boolean position(GlyphPositioningState ps, GlyphPositioningSubtable[] sta, int sequenceIndex) Apply positioning using specified state and subtable array. For each position in input sequence, apply subtables in order until some subtable applies or none remain. If no subtable applied or no input was consumed for a given position, then apply default action (no adjustments and advance). IfsequenceIndex
is non-negative, then apply subtables only when current position matchessequenceIndex
in relation to the starting position. Furthermore, upon successful application atsequenceIndex
, then discontinue processing the remaining- Parameters:
ps
- positioning statesta
- array of subtables to applysequenceIndex
- if non negative, then apply subtables only at specified sequence index- Returns:
- true if a non-zero adjustment occurred
-
position
public static final boolean position(GlyphSequence gs, String script, String language, String feature, int fontSize, GlyphPositioningSubtable[] sta, int[] widths, int[][] adjustments, ScriptContextTester sct) Apply positioning.- Parameters:
gs
- input glyph sequencescript
- taglanguage
- tagfeature
- tagfontSize
- the font sizesta
- subtable arraywidths
- arrayadjustments
- array (receives output adjustments)sct
- script context tester- Returns:
- true if a non-zero adjustment occurred
-