Package com.itextpdf.io.font.otf
Class ContextualTable<T extends ContextualRule>
- java.lang.Object
-
- com.itextpdf.io.font.otf.ContextualTable<T>
-
- Direct Known Subclasses:
ChainingContextualTable
,PosTableLookup7Format2
,SubTableLookup5Format1
,SubTableLookup5Format2
,SubTableLookup5Format3
public abstract class ContextualTable<T extends ContextualRule> extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected int
lookupFlag
protected OpenTypeFontTableReader
openReader
-
Constructor Summary
Constructors Modifier Constructor Description protected
ContextualTable(OpenTypeFontTableReader openReader, int lookupFlag)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected int
checkIfContextMatch(GlyphLine line, T rule)
Checks if given glyph line matches given rule.T
getMatchingContextRule(GlyphLine line)
Gets a most preferable context rule that matches the line at current position.protected abstract java.util.List<T>
getSetOfRulesForStartGlyph(int startId)
Gets a set of rules, which start with given glyph id.
-
-
-
Field Detail
-
openReader
protected OpenTypeFontTableReader openReader
-
lookupFlag
protected int lookupFlag
-
-
Constructor Detail
-
ContextualTable
protected ContextualTable(OpenTypeFontTableReader openReader, int lookupFlag)
-
-
Method Detail
-
getMatchingContextRule
public T getMatchingContextRule(GlyphLine line)
Gets a most preferable context rule that matches the line at current position. If no matching context rule is found, it returnsnull
.
NOTE: if matching context rule is found, theGlyphLine.start
andGlyphLine.end
will be changed in such way that they will point at start and end of the matching context glyph sequence inside the glyph line.- Parameters:
line
- a line, which is to be checked if it matches some context.- Returns:
- matching context rule or null, if none was found.
-
getSetOfRulesForStartGlyph
protected abstract java.util.List<T> getSetOfRulesForStartGlyph(int startId)
Gets a set of rules, which start with given glyph id.- Parameters:
startId
- id of the first glyph in the sequence- Returns:
- a list of
ContextualSubstRule
instances. The list will be empty if there are no rules that start with a given glyph id
-
checkIfContextMatch
protected int checkIfContextMatch(GlyphLine line, T rule)
Checks if given glyph line matches given rule.- Parameters:
line
- glyph line to be checkedrule
- rule to be compared with a given glyph line- Returns:
- either index which corresponds to the last glyph of the matching context inside the glyph line if context matches, or -1 if context doesn't match
-
-