Class GlyphSubtable
java.lang.Object
org.apache.fop.complexscripts.fonts.GlyphSubtable
- All Implemented Interfaces:
Comparable
- Direct Known Subclasses:
GlyphDefinitionSubtable
,GlyphPositioningSubtable
,GlyphSubstitutionSubtable
The GlyphSubtable
implements an abstract glyph subtable that
encapsulates identification, type, format, and coverage information.
This work was originally authored by Glenn Adams (gadams@apache.org).
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
lookup flag - ignore base glyphsstatic final int
lookup flag - ignore ligaturesstatic final int
lookup flag - ignore marksstatic final int
internal flag - use reverse scanstatic final int
lookup flag - mark attachment typestatic final int
lookup flag - reservedstatic final int
lookup flag - right to leftstatic final int
lookup flag - use mark filtering set -
Constructor Summary
ModifierConstructorDescriptionprotected
GlyphSubtable
(String lookupId, int sequence, int flags, int format, GlyphMappingTable mapping) Instantiate this glyph subtable. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
int
getCoverageIndex
(int gid) Map glyph id to coverage index.int
Map glyph id to coverage index.abstract List
int
getFlags()
static int
getFlags
(GlyphSubtable[] subtables) Determine consistent flags for a set of subtables.int
getGDEF()
int
getTable()
abstract int
abstract int
getType()
abstract String
int
hashCode()
abstract boolean
isCompatible
(GlyphSubtable subtable) Determine if a glyph subtable is compatible with this glyph subtable.void
resolveLookupReferences
(Map<String, GlyphTable.LookupTable> lookupTables) Resolve references to lookup tables, e.g., in RuleLookup, to the lookup tables themselves.void
setTable
(GlyphTable table) Establish a weak reference from this subtable to its parent table.abstract boolean
static boolean
usesReverseScan
(GlyphSubtable[] subtables) Determine if any of the specified subtables uses reverse scanning.
-
Field Details
-
LF_RIGHT_TO_LEFT
public static final int LF_RIGHT_TO_LEFTlookup flag - right to left- See Also:
-
LF_IGNORE_BASE
public static final int LF_IGNORE_BASElookup flag - ignore base glyphs- See Also:
-
LF_IGNORE_LIGATURE
public static final int LF_IGNORE_LIGATURElookup flag - ignore ligatures- See Also:
-
LF_IGNORE_MARK
public static final int LF_IGNORE_MARKlookup flag - ignore marks- See Also:
-
LF_USE_MARK_FILTERING_SET
public static final int LF_USE_MARK_FILTERING_SETlookup flag - use mark filtering set- See Also:
-
LF_RESERVED
public static final int LF_RESERVEDlookup flag - reserved- See Also:
-
LF_MARK_ATTACHMENT_TYPE
public static final int LF_MARK_ATTACHMENT_TYPElookup flag - mark attachment type- See Also:
-
LF_INTERNAL_USE_REVERSE_SCAN
public static final int LF_INTERNAL_USE_REVERSE_SCANinternal flag - use reverse scan- See Also:
-
-
Constructor Details
-
GlyphSubtable
protected GlyphSubtable(String lookupId, int sequence, int flags, int format, GlyphMappingTable mapping) Instantiate this glyph subtable.- Parameters:
lookupId
- lookup identifier, having form of "lu%d" where %d is index of lookup in lookup listsequence
- subtable sequence (within lookup), starting with zeroflags
- subtable flagsformat
- subtable formatmapping
- subtable mapping table
-
-
Method Details
-
getLookupId
- Returns:
- this subtable's lookup identifer
-
getTableType
public abstract int getTableType()- Returns:
- this subtable's table type
-
getType
public abstract int getType()- Returns:
- this subtable's type
-
getTypeName
- Returns:
- this subtable's type name
-
isCompatible
Determine if a glyph subtable is compatible with this glyph subtable. Two glyph subtables are compatible if the both may appear in a single lookup table.- Parameters:
subtable
- a glyph subtable to determine compatibility- Returns:
- true if specified subtable is compatible with this glyph subtable, where by compatible is meant that they share the same lookup type
-
usesReverseScan
public abstract boolean usesReverseScan()- Returns:
- true if subtable uses reverse scanning of glyph sequence, meaning from the last glyph in a glyph sequence to the first glyph
-
getSequence
public int getSequence()- Returns:
- this subtable's sequence (index) within lookup
-
getFlags
public int getFlags()- Returns:
- this subtable's flags
-
getFormat
public int getFormat()- Returns:
- this subtable's format
-
getGDEF
- Returns:
- this subtable's governing glyph definition table or null if none available
-
getCoverage
- Returns:
- this subtable's coverage mapping or null if mapping is not a coverage mapping
-
getClasses
- Returns:
- this subtable's class mapping or null if mapping is not a class mapping
-
getEntries
- Returns:
- this subtable's lookup entries
-
getTable
- Returns:
- this subtable's parent table (or null if undefined)
-
setTable
Establish a weak reference from this subtable to its parent table. If table parameter is specified asnull
, then clear and remove weak reference.- Parameters:
table
- the table or null- Throws:
IllegalStateException
- if table is already set to non-null
-
resolveLookupReferences
Resolve references to lookup tables, e.g., in RuleLookup, to the lookup tables themselves.- Parameters:
lookupTables
- map from lookup table identifers, e.g. "lu4", to lookup tables
-
getCoverageIndex
public int getCoverageIndex(int gid) Map glyph id to coverage index.- Parameters:
gid
- glyph id- Returns:
- the corresponding coverage index of the specified glyph id
-
getCoverageSize
public int getCoverageSize()Map glyph id to coverage index.- Returns:
- the corresponding coverage index of the specified glyph id
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable
- Returns:
- the result of comparing the lookup identifier and the sequence number of the specified subtable with the lookup identifier and sequence number of this subtable
-
usesReverseScan
Determine if any of the specified subtables uses reverse scanning.- Parameters:
subtables
- array of glyph subtables- Returns:
- true if any of the specified subtables uses reverse scanning.
-
getFlags
Determine consistent flags for a set of subtables.- Parameters:
subtables
- array of glyph subtables- Returns:
- consistent flags
- Throws:
IllegalStateException
- if inconsistent flags
-