Package com.itextpdf.io.font.otf
Class ContextualRule
- java.lang.Object
-
- com.itextpdf.io.font.otf.ContextualRule
-
- Direct Known Subclasses:
ContextualPositionRule,ContextualSubstRule
public abstract class ContextualRule extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ContextualRule()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intgetBacktrackContextLength()Gets the length of the backtrack context glyph sequence defined by this ruleabstract intgetContextLength()Gets the length of the context glyph sequence defined by this ruleintgetLookaheadContextLength()Gets 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.
-
-
-
Method Detail
-
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 idatIdx- 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 idatIdx- 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 idatIdx- index in rule sequence. Shall be: 0 <= atIdx <getBacktrackContextLength()- Returns:
trueif glyph matches element from backtrack sequence
-
-