Package com.itextpdf.io.font.otf
Class ContextualRule
java.lang.Object
com.itextpdf.io.font.otf.ContextualRule
- Direct Known Subclasses:
-
ContextualPositionRule,ContextualSubstRule
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the length of the backtrack context glyph sequence defined by this ruleabstract intGets the length of the context glyph sequence defined by this ruleintGets the length of the lookahead context glyph sequence defined by this rulebooleanisGlyphMatchesBacktrack(int glyphId, int atIdx) Checks if glyph line element matches element from backtrack sequence of the rule.abstract booleanisGlyphMatchesInput(int glyphId, int atIdx) Checks if glyph line element matches element from input sequence of the rule.booleanisGlyphMatchesLookahead(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:
-
trueif 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:
-
trueif 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:
-
trueif glyph matches element from backtrack sequence
-