Class GlyphDefinitionTable
java.lang.Object
org.docx4j.fonts.fop.complexscripts.fonts.GlyphTable
org.docx4j.fonts.fop.complexscripts.fonts.GlyphDefinitionTable
public class GlyphDefinitionTable extends GlyphTable
The GlyphDefinitionTable class is a glyph table that implements
glyph definition functionality according to the OpenType GDEF table.
This work was originally authored by Glenn Adams (gadams@apache.org).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.docx4j.fonts.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
Fields Modifier and Type Field Description static intGDEF_LOOKUP_TYPE_ATTACHMENT_POINTattachment point subtable typestatic intGDEF_LOOKUP_TYPE_GLYPH_CLASSglyph class subtable typestatic intGDEF_LOOKUP_TYPE_LIGATURE_CARETligature caret subtable typestatic intGDEF_LOOKUP_TYPE_MARK_ATTACHMENTmark attachment subtable typestatic intGLYPH_CLASS_BASEpre-defined glyph class - base glyphstatic intGLYPH_CLASS_COMPONENTpre-defined glyph class - component glyphstatic intGLYPH_CLASS_LIGATUREpre-defined glyph class - ligature glyphstatic intGLYPH_CLASS_MARKpre-defined glyph class - mark glyphFields inherited from class org.docx4j.fonts.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
Constructors Constructor Description GlyphDefinitionTable(java.util.List subtables, java.util.Map<java.lang.String,ScriptProcessor> processors)Instantiate aGlyphDefinitionTableobject using the specified subtables. -
Method Summary
Modifier and Type Method Description protected voidaddSubtable(GlyphSubtable subtable)Add a subtable.static GlyphSubtablecreateSubtable(int type, java.lang.String id, int sequence, int flags, int format, GlyphMappingTable mapping, java.util.List entries)Create a definition subtable according to the specified arguments.intgetGlyphClass(int gid)Determine glyph class.static intgetLookupTypeFromName(java.lang.String name)Map a lookup type name to its constant (integer) value.static java.lang.StringgetLookupTypeName(int type)Map a lookup type constant (integer) value to its name.intgetMarkAttachClass(int gid)Determine mark attachment class.booleanisGlyphClass(int gid, int gc)Determine if glyph belongs to pre-defined glyph class.booleanisMarkAttachClass(int gid, int mac)Determine if glyph belongs to (font specific) mark attachment class.GlyphSequencereorderCombiningMarks(GlyphSequence gs, int[] widths, int[][] gpa, java.lang.String script, java.lang.String language)Reorder combining marks in glyph sequence so that they precede (within the sequence) the base character to which they are applied.Methods inherited from class org.docx4j.fonts.fop.complexscripts.fonts.GlyphTable
assembleLookups, findLookupTables, freezeSubtables, getGlyphDefinitions, getLookups, getLookupTable, getLookupTables, getTableTypeFromName, hasFeature, matchLookups, matchLookupSpecs, resolveLookupReferences, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
GDEF_LOOKUP_TYPE_GLYPH_CLASS
public static final int GDEF_LOOKUP_TYPE_GLYPH_CLASSglyph class subtable type- See Also:
- Constant Field Values
-
GDEF_LOOKUP_TYPE_ATTACHMENT_POINT
public static final int GDEF_LOOKUP_TYPE_ATTACHMENT_POINTattachment point subtable type- See Also:
- Constant Field Values
-
GDEF_LOOKUP_TYPE_LIGATURE_CARET
public static final int GDEF_LOOKUP_TYPE_LIGATURE_CARETligature caret subtable type- See Also:
- Constant Field Values
-
GDEF_LOOKUP_TYPE_MARK_ATTACHMENT
public static final int GDEF_LOOKUP_TYPE_MARK_ATTACHMENTmark attachment subtable type- See Also:
- Constant Field Values
-
GLYPH_CLASS_BASE
public static final int GLYPH_CLASS_BASEpre-defined glyph class - base glyph- See Also:
- Constant Field Values
-
GLYPH_CLASS_LIGATURE
public static final int GLYPH_CLASS_LIGATUREpre-defined glyph class - ligature glyph- See Also:
- Constant Field Values
-
GLYPH_CLASS_MARK
public static final int GLYPH_CLASS_MARKpre-defined glyph class - mark glyph- See Also:
- Constant Field Values
-
GLYPH_CLASS_COMPONENT
public static final int GLYPH_CLASS_COMPONENTpre-defined glyph class - component glyph- See Also:
- Constant Field Values
-
-
Constructor Details
-
GlyphDefinitionTable
public GlyphDefinitionTable(java.util.List subtables, java.util.Map<java.lang.String,ScriptProcessor> processors)Instantiate aGlyphDefinitionTableobject using the specified subtables.- Parameters:
subtables- a list of identified subtables
-
-
Method Details
-
reorderCombiningMarks
public GlyphSequence reorderCombiningMarks(GlyphSequence gs, int[] widths, int[][] gpa, java.lang.String script, java.lang.String language)Reorder combining marks in glyph sequence so that they precede (within the sequence) the base character to which they are applied. N.B. In the case of LTR segments, marks are not reordered by this, method since when the segment is reversed by BIDI processing, marks are automatically reordered to precede their base glyph.- Parameters:
gs- an input glyph sequencewidths- associated advance widths (also reordered)gpa- associated glyph position adjustments (also reordered)script- a script identifierlanguage- a language identifier- Returns:
- the reordered (output) glyph sequence
-
addSubtable
Add a subtable.- Overrides:
addSubtablein classGlyphTable- Parameters:
subtable- a (non-null) glyph subtable
-
isGlyphClass
public boolean isGlyphClass(int gid, int gc)Determine if glyph belongs to pre-defined glyph class.- Parameters:
gid- a glyph identifier (index)gc- a pre-defined glyph class (GLYPH_CLASS_BASE|GLYPH_CLASS_LIGATURE|GLYPH_CLASS_MARK|GLYPH_CLASS_COMPONENT).- Returns:
- true if glyph belongs to specified glyph class
-
getGlyphClass
public int getGlyphClass(int gid)Determine glyph class.- Parameters:
gid- a glyph identifier (index)- Returns:
- a pre-defined glyph class (GLYPH_CLASS_BASE|GLYPH_CLASS_LIGATURE|GLYPH_CLASS_MARK|GLYPH_CLASS_COMPONENT).
-
isMarkAttachClass
public boolean isMarkAttachClass(int gid, int mac)Determine if glyph belongs to (font specific) mark attachment class.- Parameters:
gid- a glyph identifier (index)mac- a (font specific) mark attachment class- Returns:
- true if glyph belongs to specified mark attachment class
-
getMarkAttachClass
public int getMarkAttachClass(int gid)Determine mark attachment class.- Parameters:
gid- a glyph identifier (index)- Returns:
- a non-negative mark attachment class, or -1 if no class defined
-
getLookupTypeFromName
public static int getLookupTypeFromName(java.lang.String name)Map a lookup type name to its constant (integer) value.- Parameters:
name- lookup type name- Returns:
- lookup type
-
getLookupTypeName
public static java.lang.String getLookupTypeName(int type)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, java.lang.String id, int sequence, int flags, int format, GlyphMappingTable mapping, java.util.List entries)Create a definition subtable according to the specified arguments.- Parameters:
type- subtable typeid- subtable identifiersequence- subtable sequenceflags- subtable flags (must be zero)format- subtable formatmapping- subtable mapping tableentries- subtable entries- Returns:
- a glyph subtable instance
-