Class GlyphTable.LookupTable
- java.lang.Object
-
- org.apache.fop.complexscripts.fonts.GlyphTable.LookupTable
-
- All Implemented Interfaces:
java.lang.Comparable
- Enclosing class:
- GlyphTable
public static class GlyphTable.LookupTable extends java.lang.Object implements java.lang.ComparableTheLookupTableclass comprising an identifier and an ordered list of glyph subtables, each of which employ the same lookup identifier.
-
-
Constructor Summary
Constructors Constructor Description LookupTable(java.lang.String id, java.util.List<GlyphSubtable> subtables)Instantiate a LookupTable.LookupTable(java.lang.String id, GlyphSubtable subtable)Instantiate a LookupTable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddSubtable(GlyphSubtable subtable)Add a subtable into this lookup table's collecion of subtables according to its natural order.intcompareTo(java.lang.Object o)booleanequals(java.lang.Object o)voidfreezeSubtables(java.util.Map<java.lang.String,GlyphTable.LookupTable> lookupTables)Freeze subtables, i.e., do not allow further subtable addition, and create resulting cached state.GlyphSubtable[]getSubtables()inthashCode()booleanperformsPositioning()Determine if this glyph table performs positioning.booleanperformsSubstitution()Determine if this glyph table performs substitution.booleanposition(GlyphPositioningState ps, int sequenceIndex)Perform positioning processing on an existing glyph positioning state object using this lookup table's subtables.booleanposition(GlyphSequence gs, java.lang.String script, java.lang.String language, java.lang.String feature, int fontSize, int[] widths, int[][] adjustments, ScriptContextTester sct)Perform positioning processing using this lookup table's subtables.GlyphSequencesubstitute(GlyphSubstitutionState ss, int sequenceIndex)Perform substitution processing on an existing glyph substitution state object using this lookup table's subtables.GlyphSequencesubstitute(GlyphSequence gs, java.lang.String script, java.lang.String language, java.lang.String feature, ScriptContextTester sct)Perform substitution processing using this lookup table's subtables.java.lang.StringtoString()
-
-
-
Constructor Detail
-
LookupTable
public LookupTable(java.lang.String id, GlyphSubtable subtable)Instantiate a LookupTable.- Parameters:
id- the lookup table's identifiersubtable- an initial subtable (or null)
-
LookupTable
public LookupTable(java.lang.String id, java.util.List<GlyphSubtable> subtables)Instantiate a LookupTable.- Parameters:
id- the lookup table's identifiersubtables- 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(java.util.Map<java.lang.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, java.lang.String script, java.lang.String language, java.lang.String feature, ScriptContextTester sct)
Perform substitution processing using this lookup table's subtables.- Parameters:
gs- an input glyph sequencescript- a script identifierlanguage- a language identifierfeature- a feature identifiersct- 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 objectsequenceIndex- 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, java.lang.String script, java.lang.String language, java.lang.String feature, int fontSize, int[] widths, int[][] adjustments, ScriptContextTester sct)
Perform positioning processing using this lookup table's subtables.- Parameters:
gs- an input glyph sequencescript- a script identifierlanguage- a language identifierfeature- a feature identifierfontSize- size in device unitswidths- array of default advancements for each glyph in fontadjustments- 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 sequencesct- 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 objectsequenceIndex- 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object- Returns:
- true if identifier of the specified lookup table is the same as the identifier of this lookup table
-
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareToin interfacejava.lang.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 java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-