public class GlyphPositioningState extends GlyphProcessingState
The GlyphPositioningState
implements an state object used during glyph positioning
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 |
---|
GlyphPositioningState()
Construct default (reset) glyph positioning state.
|
GlyphPositioningState(GlyphPositioningState ps)
Construct glyph positioning state using an existing state object using shallow copy
except as follows: input glyph sequence is copied deep except for its characters array.
|
GlyphPositioningState(GlyphSequence gs,
java.lang.String script,
java.lang.String language,
java.lang.String feature,
int fontSize,
int[] widths,
int[][] adjustments,
ScriptContextTester sct)
Construct glyph positioning state.
|
Modifier and Type | Method and Description |
---|---|
boolean |
adjust(GlyphPositioningTable.Value v)
Perform adjustments at current position index.
|
boolean |
adjust(GlyphPositioningTable.Value v,
int offset)
Perform adjustments at specified offset from current position index.
|
boolean |
apply(GlyphPositioningSubtable st)
Apply positioning subtable to current state at current position (only),
resulting in the consumption of zero or more input glyphs.
|
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.
|
boolean |
getAdjusted()
Get adjusted state.
|
int[] |
getAdjustment()
Obtain current adjustments at current position index.
|
int[] |
getAdjustment(int offset)
Obtain current adjustments at specified offset from current position index.
|
int |
getWidth(int gi)
Obtain design advancement (width) of glyph at specified index.
|
GlyphPositioningState |
reset(GlyphSequence gs,
java.lang.String script,
java.lang.String language,
java.lang.String feature,
int fontSize,
int[] widths,
int[][] adjustments,
ScriptContextTester sct)
Reset glyph positioning state.
|
void |
setAdjusted(boolean adjusted)
Set adjusted state, used to record effect of non-zero adjustment.
|
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, reset, setGDEF, setGlyph, setIgnoreDefault, setLookupFlags, setPosition, updateSubtableState
public GlyphPositioningState()
public GlyphPositioningState(GlyphSequence gs, java.lang.String script, java.lang.String language, java.lang.String feature, int fontSize, int[] widths, int[][] adjustments, ScriptContextTester sct)
gs
- input glyph sequencescript
- script identifierlanguage
- language identifierfeature
- feature identifierfontSize
- font size (in micropoints)widths
- array of design advancements (in glyph index order)adjustments
- positioning adjustments to which positioning is appliedsct
- script context tester (or null)public GlyphPositioningState(GlyphPositioningState ps)
ps
- existing positioning state to copy frompublic GlyphPositioningState reset(GlyphSequence gs, java.lang.String script, java.lang.String language, java.lang.String feature, int fontSize, int[] widths, int[][] adjustments, ScriptContextTester sct)
gs
- input glyph sequencescript
- script identifierlanguage
- language identifierfeature
- feature identifierfontSize
- font size (in micropoints)widths
- array of design advancements (in glyph index order)adjustments
- positioning adjustments to which positioning is appliedsct
- script context tester (or null)public int getWidth(int gi)
gi
- glyph indexpublic boolean adjust(GlyphPositioningTable.Value v)
v
- value containing adjustmentspublic boolean adjust(GlyphPositioningTable.Value v, int offset)
v
- value containing adjustmentsoffset
- from current position indexpublic int[] getAdjustment()
public int[] getAdjustment(int offset) throws java.lang.IndexOutOfBoundsException
offset
- from current position indexjava.lang.IndexOutOfBoundsException
- if offset is invalidpublic boolean apply(GlyphPositioningSubtable st)
st
- the glyph positioning 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
public void setAdjusted(boolean adjusted)
adjusted
- true if to set adjusted state, otherwise false to
clear adjusted statepublic boolean getAdjusted()
setAdjusted(boolean)
; otherwise, false.Copyright 1999-2017 The Apache Software Foundation. All Rights Reserved.