Package com.itextpdf.io.font.otf
Class ContextualRule
java.lang.Object
com.itextpdf.io.font.otf.ContextualRule
- Direct Known Subclasses:
-
ContextualPositionRule
,ContextualSubstRule
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the length of the backtrack context glyph sequence defined by this ruleabstract int
Gets the length of the context glyph sequence defined by this ruleint
Gets the length of the lookahead context glyph sequence defined by this ruleboolean
isGlyphMatchesBacktrack
(int glyphId, int atIdx) Checks if glyph line element matches element from backtrack sequence of the rule.abstract boolean
isGlyphMatchesInput
(int glyphId, int atIdx) Checks if glyph line element matches element from input sequence of the rule.boolean
isGlyphMatchesLookahead
(int glyphId, int atIdx) Checks if glyph line element matches element from lookahead sequence of the rule.
-
Constructor Details
-
ContextualRule
public ContextualRule()
-
-
Method Details
-
getContextLength
public abstract int getContextLength()Gets the length of the context glyph sequence defined by this rule- Returns:
- length of the context
-
isGlyphMatchesInput
public abstract boolean isGlyphMatchesInput(int glyphId, int atIdx) Checks if glyph line element matches element from input sequence of the rule.
NOTE: rules do not contain the first element of the input sequence, the first element is defined by rule position in substitution table. Therefore atIdx shall not be 0.- Parameters:
-
glyphId
- glyph code id -
atIdx
- index in the rule sequence. Shall be: 0 < atIdx <getContextLength()
- Returns:
-
true
if glyph matches element
-
getLookaheadContextLength
public int getLookaheadContextLength()Gets the length of the lookahead context glyph sequence defined by this rule- Returns:
- length of the lookahead context
-
getBacktrackContextLength
public int getBacktrackContextLength()Gets the length of the backtrack context glyph sequence defined by this rule- Returns:
- length of the backtrack context
-
isGlyphMatchesLookahead
public boolean isGlyphMatchesLookahead(int glyphId, int atIdx) Checks if glyph line element matches element from lookahead sequence of the rule.- Parameters:
-
glyphId
- glyph code id -
atIdx
- index in rule sequence. Shall be: 0 <= atIdx <getLookaheadContextLength()
- Returns:
-
true
if glyph matches element from lookahead sequence
-
isGlyphMatchesBacktrack
public boolean isGlyphMatchesBacktrack(int glyphId, int atIdx) Checks if glyph line element matches element from backtrack sequence of the rule.- Parameters:
-
glyphId
- glyph code id -
atIdx
- index in rule sequence. Shall be: 0 <= atIdx <getBacktrackContextLength()
- Returns:
-
true
if glyph matches element from backtrack sequence
-