Class GlyphPositioningTable
java.lang.Object
org.apache.fop.complexscripts.fonts.GlyphTable
org.apache.fop.complexscripts.fonts.GlyphPositioningTable
The GlyphPositioningTable class is a glyph table that implements
GlyphPositioning functionality.
This work was originally authored by Glenn Adams (gadams@apache.org).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTheAnchorclass implements a anchor record, comprising an X,Y coordinate pair, an optional anchor point index (or -1), and optional X or Y device tables (or null if absent).static classTheDeviceTableclass implements a positioning device table record, comprising adjustments to be made to scaled design units according to the scaled size.static classTheMarkAnchorclass is a subclass of theAnchorclass, adding a mark class designation.static classThePairValuesclass implements a pair value record, comprising a glyph id (or zero) and two optional positioning values.static classTheValueclass implements a positioning value record, comprising placement and advancement information in X and Y axes, and optionally including device data used to perform device (grid-fitted) specific fine grain adjustments.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
FieldsModifier and TypeFieldDescriptionstatic final intchained contextual positioning subtable typestatic final intcontextual positioning subtable typestatic final intcursive positioning subtable typestatic final intextension positioning subtable typestatic final intmark to base positioning subtable typestatic final intmark to ligature positioning subtable typestatic final intmark to mark positioning subtable typestatic final intmultiple positioning subtable typestatic final intsingle positioning 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
ConstructorsConstructorDescriptionGlyphPositioningTable(GlyphDefinitionTable gdef, Map lookups, List subtables, Map<String, ScriptProcessor> processors) Instantiate aGlyphPositioningTableobject using the specified lookups and subtables. -
Method Summary
Modifier and TypeMethodDescriptionstatic GlyphSubtablecreateSubtable(int type, String id, int sequence, int flags, int format, List coverage, List entries) Create a positioning subtable according to the specified arguments.static GlyphSubtablecreateSubtable(int type, String id, int sequence, int flags, int format, GlyphCoverageTable coverage, List entries) Create a positioning subtable according to the specified arguments.static intgetLookupTypeFromName(String name) Map a lookup type name to its constant (integer) value.static StringgetLookupTypeName(int type) Map a lookup type constant (integer) value to its name.booleanposition(GlyphSequence gs, String script, String language, int fontSize, int[] widths, int[][] adjustments) Perform positioning 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
-
GPOS_LOOKUP_TYPE_SINGLE
public static final int GPOS_LOOKUP_TYPE_SINGLEsingle positioning subtable type- See Also:
-
GPOS_LOOKUP_TYPE_PAIR
public static final int GPOS_LOOKUP_TYPE_PAIRmultiple positioning subtable type- See Also:
-
GPOS_LOOKUP_TYPE_CURSIVE
public static final int GPOS_LOOKUP_TYPE_CURSIVEcursive positioning subtable type- See Also:
-
GPOS_LOOKUP_TYPE_MARK_TO_BASE
public static final int GPOS_LOOKUP_TYPE_MARK_TO_BASEmark to base positioning subtable type- See Also:
-
GPOS_LOOKUP_TYPE_MARK_TO_LIGATURE
public static final int GPOS_LOOKUP_TYPE_MARK_TO_LIGATUREmark to ligature positioning subtable type- See Also:
-
GPOS_LOOKUP_TYPE_MARK_TO_MARK
public static final int GPOS_LOOKUP_TYPE_MARK_TO_MARKmark to mark positioning subtable type- See Also:
-
GPOS_LOOKUP_TYPE_CONTEXTUAL
public static final int GPOS_LOOKUP_TYPE_CONTEXTUALcontextual positioning subtable type- See Also:
-
GPOS_LOOKUP_TYPE_CHAINED_CONTEXTUAL
public static final int GPOS_LOOKUP_TYPE_CHAINED_CONTEXTUALchained contextual positioning subtable type- See Also:
-
GPOS_LOOKUP_TYPE_EXTENSION_POSITIONING
public static final int GPOS_LOOKUP_TYPE_EXTENSION_POSITIONINGextension positioning subtable type- See Also:
-
-
Constructor Details
-
GlyphPositioningTable
public GlyphPositioningTable(GlyphDefinitionTable gdef, Map lookups, List subtables, Map<String, ScriptProcessor> processors) Instantiate aGlyphPositioningTableobject 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
-
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 positioning 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 positioning 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
-
position
public boolean position(GlyphSequence gs, String script, String language, int fontSize, int[] widths, int[][] adjustments) Perform positioning processing using all matching lookups.- Parameters:
gs- an input glyph sequencescript- a script identifierlanguage- a language identifierfontSize- size in device unitswidths- array of default advancements for each glyphadjustments- accumulated adjustments array (sequence) of 4-tuples of placement [PX,PY] and advance [AX,AY] adjustments, in that order, with one 4-tuple for each element of glyph sequence- Returns:
- true if some adjustment is not zero; otherwise, false
-