public class GlyphSubstitutionState extends GlyphProcessingState
The GlyphSubstitutionState
implements an state object used during glyph substitution
processing.
This work was originally authored by Glenn Adams (gadams@apache.org).
classMatchSet, consumed, feature, gct, gdef, ignoreBase, ignoreDefault, ignoreLigature, ignoreMark, igs, index, indexLast, language, lookupFlags, script, sct
Constructor and Description |
---|
GlyphSubstitutionState()
Construct default (reset) glyph substitution state.
|
GlyphSubstitutionState(GlyphSequence gs,
java.lang.String script,
java.lang.String language,
java.lang.String feature,
ScriptContextTester sct)
Construct glyph substitution state.
|
GlyphSubstitutionState(GlyphSubstitutionState ss)
Construct glyph substitution state using an existing state object using shallow copy
except as follows: input glyph sequence is copied deep except for its characters array.
|
Modifier and Type | Method and Description |
---|---|
boolean |
apply(GlyphSubstitutionSubtable st)
Apply substitution subtable to current state at current position (only),
resulting in the consumption of zero or more input glyphs, and possibly
replacing the current input glyphs starting at the current position, in
which case it is possible that indexLast is altered to be either less than
or greater than its value prior to this application.
|
boolean |
apply(GlyphTable.RuleLookup[] lookups,
int nig)
Apply a sequence of matched rule lookups to the
nig input glyphs
starting at the current position. |
void |
applyDefault()
Apply default application semantices; namely, consume one input glyph,
writing that glyph (and its association) to the output glyphs (and associations).
|
int |
getAlternatesIndex(int ci)
Obtain alternates index associated with specified coverage index.
|
GlyphSequence |
getOutput()
Obtain output glyph sequence.
|
void |
putGlyph(int glyph,
CharAssociation a,
java.lang.Object predication)
Put (write) glyph into glyph output buffer.
|
void |
putGlyphs(int[] glyphs,
CharAssociation[] associations,
java.lang.Object predication)
Put (write) array of glyphs into glyph output buffer.
|
GlyphSubstitutionState |
reset(GlyphSequence gs,
java.lang.String script,
java.lang.String language,
java.lang.String feature,
ScriptContextTester sct)
Reset glyph substitution state.
|
void |
setAlternates(int[] alternates)
Set alternates indices.
|
consume, didConsume, erase, getAssociation, getAssociation, getAssociations, getAssociations, getClassMatchSet, getCombinedAndTester, getCombinedIgnoreTester, getCombinedOrTester, getGDEF, getGlyph, getGlyph, getGlyphs, getGlyphs, getGlyphs, getGlyphsAvailable, getGlyphsAvailable, getGlyphsAvailable, getIgnoredAssociations, getIgnoredAssociations, getIgnoreDefault, getIgnoredGlyphs, getIgnoredGlyphs, getIgnoreTester, getInput, getLastPosition, getLookupFlags, getPosition, hasNext, hasNext, hasPrev, hasPrev, isBase, isIgnoredBase, isIgnoredGlyph, isIgnoredGlyph, isIgnoredGlyph, isIgnoredLigature, isIgnoredMark, isLigature, isMark, maybeApplicable, next, prev, replaceInput, replaceInput, setGDEF, setGlyph, setIgnoreDefault, setLookupFlags, setPosition, updateSubtableState
public GlyphSubstitutionState()
public GlyphSubstitutionState(GlyphSequence gs, java.lang.String script, java.lang.String language, java.lang.String feature, ScriptContextTester sct)
gs
- input glyph sequencescript
- script identifierlanguage
- language identifierfeature
- feature identifiersct
- script context tester (or null)public GlyphSubstitutionState(GlyphSubstitutionState ss)
ss
- existing positioning state to copy frompublic GlyphSubstitutionState reset(GlyphSequence gs, java.lang.String script, java.lang.String language, java.lang.String feature, ScriptContextTester sct)
reset
in class GlyphProcessingState
gs
- input glyph sequencescript
- script identifierlanguage
- language identifierfeature
- feature identifiersct
- script context tester (or null)public void setAlternates(int[] alternates)
alternates
- array of alternates indices ordered by coverage indexpublic int getAlternatesIndex(int ci)
ci
- coverage indexpublic void putGlyph(int glyph, CharAssociation a, java.lang.Object predication)
glyph
- to writea
- character association that applies to glyphpredication
- a predication value to add to association A if predications enabledpublic void putGlyphs(int[] glyphs, CharAssociation[] associations, java.lang.Object predication)
glyphs
- to writeassociations
- array of character associations that apply to glyphspredication
- optional predicaion object to be associated with glyphs' associationspublic GlyphSequence getOutput()
public boolean apply(GlyphSubstitutionSubtable st)
st
- the glyph substitution subtable to applypublic boolean apply(GlyphTable.RuleLookup[] lookups, int nig)
nig
input glyphs
starting at the current position. If lookups are non-null and non-empty, then
all input glyphs specified by nig
are consumed irregardless of
whether any specified lookup applied.lookups
- array of matched lookups (or null)nig
- number of glyphs in input sequence, starting at current position, to which
the lookups are to apply, and to be consumed once the application has finishedpublic void applyDefault()
applyDefault
in class GlyphProcessingState
Copyright 1999-2017 The Apache Software Foundation. All Rights Reserved.