Class GlyphSubstitutionTable
java.lang.Object
org.apache.fop.complexscripts.fonts.GlyphTable
org.apache.fop.complexscripts.fonts.GlyphSubstitutionTable
The GlyphSubstitutionTable
class is a glyph table that implements
GlyphSubstitution
functionality.
This work was originally authored by Glenn Adams (gadams@apache.org).
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
TheLigature
class implements a ligature lookup result in terms of a ligature glyph (code) and the N+1...static class
TheLigatureSet
class implements a set of ligatures.Nested classes/interfaces inherited from class org.apache.fop.complexscripts.fonts.GlyphTable
GlyphTable.ChainedClassSequenceRule, GlyphTable.ChainedCoverageSequenceRule, GlyphTable.ChainedGlyphSequenceRule, GlyphTable.ClassSequenceRule, GlyphTable.CoverageSequenceRule, GlyphTable.GlyphSequenceRule, GlyphTable.HomogeneousRuleSet, GlyphTable.LookupSpec, GlyphTable.LookupTable, GlyphTable.Rule, GlyphTable.RuleLookup, GlyphTable.RuleSet, GlyphTable.UseSpec
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
alternate substitution subtable typestatic final int
chained contextual substitution subtable typestatic final int
contextual substitution subtable typestatic final int
extension substitution substitution subtable typestatic final int
ligature substitution subtable typestatic final int
multiple substitution subtable typestatic final int
reverse chained contextual single substitution subtable typestatic final int
single substitution subtable typeFields inherited from class org.apache.fop.complexscripts.fonts.GlyphTable
GLYPH_TABLE_TYPE_BASELINE, GLYPH_TABLE_TYPE_DEFINITION, GLYPH_TABLE_TYPE_JUSTIFICATION, GLYPH_TABLE_TYPE_POSITIONING, GLYPH_TABLE_TYPE_SUBSTITUTION, processors
-
Constructor Summary
ConstructorDescriptionGlyphSubstitutionTable
(GlyphDefinitionTable gdef, Map lookups, List subtables, Map<String, ScriptProcessor> processors) Instantiate aGlyphSubstitutionTable
object using the specified lookups and subtables. -
Method Summary
Modifier and TypeMethodDescriptionstatic GlyphSubtable
createSubtable
(int type, String id, int sequence, int flags, int format, List coverage, List entries) Create a substitution subtable according to the specified arguments.static GlyphSubtable
createSubtable
(int type, String id, int sequence, int flags, int format, GlyphCoverageTable coverage, List entries) Create a substitution subtable according to the specified arguments.static int
getLookupTypeFromName
(String name) Map a lookup type name to its constant (integer) value.static String
getLookupTypeName
(int type) Map a lookup type constant (integer) value to its name.preProcess
(CharSequence charSequence, String script, MultiByteFont font, List associations) substitute
(GlyphSequence gs, String script, String language) Perform substitution processing using all matching lookups.Methods inherited from class org.apache.fop.complexscripts.fonts.GlyphTable
addSubtable, assembleLookups, findLookupTables, freezeSubtables, getGlyphDefinitions, getLookups, getLookupTable, getLookupTables, getTableTypeFromName, hasFeature, matchLookups, matchLookupSpecs, resolveLookupReferences, toString
-
Field Details
-
GSUB_LOOKUP_TYPE_SINGLE
public static final int GSUB_LOOKUP_TYPE_SINGLEsingle substitution subtable type- See Also:
-
GSUB_LOOKUP_TYPE_MULTIPLE
public static final int GSUB_LOOKUP_TYPE_MULTIPLEmultiple substitution subtable type- See Also:
-
GSUB_LOOKUP_TYPE_ALTERNATE
public static final int GSUB_LOOKUP_TYPE_ALTERNATEalternate substitution subtable type- See Also:
-
GSUB_LOOKUP_TYPE_LIGATURE
public static final int GSUB_LOOKUP_TYPE_LIGATUREligature substitution subtable type- See Also:
-
GSUB_LOOKUP_TYPE_CONTEXTUAL
public static final int GSUB_LOOKUP_TYPE_CONTEXTUALcontextual substitution subtable type- See Also:
-
GSUB_LOOKUP_TYPE_CHAINED_CONTEXTUAL
public static final int GSUB_LOOKUP_TYPE_CHAINED_CONTEXTUALchained contextual substitution subtable type- See Also:
-
GSUB_LOOKUP_TYPE_EXTENSION_SUBSTITUTION
public static final int GSUB_LOOKUP_TYPE_EXTENSION_SUBSTITUTIONextension substitution substitution subtable type- See Also:
-
GSUB_LOOKUP_TYPE_REVERSE_CHAINED_SINGLE
public static final int GSUB_LOOKUP_TYPE_REVERSE_CHAINED_SINGLEreverse chained contextual single substitution subtable type- See Also:
-
-
Constructor Details
-
GlyphSubstitutionTable
public GlyphSubstitutionTable(GlyphDefinitionTable gdef, Map lookups, List subtables, Map<String, ScriptProcessor> processors) Instantiate aGlyphSubstitutionTable
object using the specified lookups and subtables.- Parameters:
gdef
- glyph definition table that applieslookups
- a map of lookup specifications to subtable identifier stringssubtables
- a list of identified subtables
-
-
Method Details
-
substitute
Perform substitution processing using all matching lookups.- Parameters:
gs
- an input glyph sequencescript
- a script identifierlanguage
- a language identifier- Returns:
- the substituted (output) glyph sequence
-
preProcess
public CharSequence preProcess(CharSequence charSequence, String script, MultiByteFont font, List associations) -
getLookupTypeFromName
Map a lookup type name to its constant (integer) value.- Parameters:
name
- lookup type name- Returns:
- lookup type
-
getLookupTypeName
Map a lookup type constant (integer) value to its name.- Parameters:
type
- lookup type- Returns:
- lookup type name
-
createSubtable
public static GlyphSubtable createSubtable(int type, String id, int sequence, int flags, int format, GlyphCoverageTable coverage, List entries) Create a substitution subtable according to the specified arguments.- Parameters:
type
- subtable typeid
- subtable identifiersequence
- subtable sequenceflags
- subtable flagsformat
- subtable formatcoverage
- subtable coverage tableentries
- subtable entries- Returns:
- a glyph subtable instance
-
createSubtable
public static GlyphSubtable createSubtable(int type, String id, int sequence, int flags, int format, List coverage, List entries) Create a substitution subtable according to the specified arguments.- Parameters:
type
- subtable typeid
- subtable identifiersequence
- subtable sequenceflags
- subtable flagsformat
- subtable formatcoverage
- list of coverage table entriesentries
- subtable entries- Returns:
- a glyph subtable instance
-