Package com.itextpdf.io.font.otf
Class ContextualTableContextualRule>
java.lang.Object
com.itextpdf.io.font.otf.ContextualTable
- Type Parameters:
-
T- the contextual rule type stored by this table
- Direct Known Subclasses:
-
ChainingContextualTable,PosTableLookup7Format2,SubTableLookup5Format1,SubTableLookup5Format2,SubTableLookup5Format3
Represents the contextual table of an OpenType font.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intSpecifies processing options, e.g.protected OpenTypeFontTableReaderStores open reader. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedContextualTable(OpenTypeFontTableReader openReader, int lookupFlag) Creates a new contextual table. -
Method Summary
Modifier and TypeMethodDescriptionprotected intcheckIfContextMatch(GlyphLine line, T rule) Checks if given glyph line matches given rule.Gets a most preferable context rule that matches the line at current position.getSetOfRulesForStartGlyph(int startId) Gets a set of rules, which start with given glyph id.
-
Field Details
-
openReader
Stores open reader. -
lookupFlag
protected int lookupFlagSpecifies processing options, e.g. whether to skip base glyphs, marks or ligatures during glyph substitution or positioning. See Lookup table
-
-
Constructor Details
-
ContextualTable
Creates a new contextual table.- Parameters:
-
openReader- the OpenType font reader -
lookupFlag- specifies processing options, e.g. whether to skip base glyphs, marks or ligatures during glyph substitution or positioning. See Lookup table
-
-
Method Details
-
getMatchingContextRule
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.startandGlyphLine.endwill 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
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
ContextualSubstRuleinstances. The list will be empty if there are no rules that start with a given glyph id
-
checkIfContextMatch
Checks if given glyph line matches given rule.- Parameters:
-
line- glyph line to be checked -
rule- 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
-