org.extex.font.format.xtf.tables.gps
Class OtfTableGSUB

java.lang.Object
  extended by org.extex.font.format.xtf.tables.AbstractXtfTable
      extended by org.extex.font.format.xtf.tables.gps.AbstractXtfSFLTable
          extended by org.extex.font.format.xtf.tables.gps.OtfTableGSUB
All Implemented Interfaces:
LookupTableFactory, XtfGlyphName, XtfTable, XMLWriterConvertible

public class OtfTableGSUB
extends AbstractXtfSFLTable
implements XtfTable, LookupTableFactory, XMLWriterConvertible

Glyph substitution (GSUB).

To access GSUB information, clients should use the following procedure:

  1. Locate the current script in the GSUB ScriptList table.
  2. If the language system is known, search the script for the correct LangSys table; otherwise, use the script's default language system (DefaultLangSys table).
  3. The LangSys table provides index numbers into the GSUB FeatureList table to access a required feature and a number of additional features.
  4. Inspect the FeatureTag of each feature, and select the features to apply to an input glyph string. Each feature provides an array of index numbers into the GSUB LookupList table.
  5. Assemble all lookups from the set of chosen features, and apply the lookups in the order given in the LookupList table.

Version:
$Revision: 7274 $
Author:
Michael Niedermair

Field Summary
 
Fields inherited from class org.extex.font.format.xtf.tables.gps.AbstractXtfSFLTable
featureList, lookupList, scriptList
 
Constructor Summary
OtfTableGSUB(XtfTableMap tablemap, XtfTableDirectory.Entry de, RandomAccessR rar)
          Create a new object
 
Method Summary
 java.lang.String getShortcut()
          Returns the table shortcut.
 int getType()
          Get the table type, as a table directory value.
 java.lang.String lookupType(int type)
          Returns the name of the lookup type (The start index is 1!).
 XtfLookupTable read(RandomAccessR rar, int posOffset, int type, int offset, XtfGlyphName xtfGlyph)
          Read the LookupTable or null, if not found.
 
Methods inherited from class org.extex.font.format.xtf.tables.gps.AbstractXtfSFLTable
findLangSys, findLookup, findScript, getFeatureList, getFeatureTag, getLookupList, getScriptList, writeXML
 
Methods inherited from class org.extex.font.format.xtf.tables.AbstractXtfTable
getGlyphName, getInitOrder, getTableMap, init, writeStartElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.extex.font.format.xtf.tables.XtfTable
getInitOrder, getTableMap, init
 
Methods inherited from interface org.extex.util.xml.XMLWriterConvertible
writeXML
 

Constructor Detail

OtfTableGSUB

public OtfTableGSUB(XtfTableMap tablemap,
                    XtfTableDirectory.Entry de,
                    RandomAccessR rar)
             throws java.io.IOException
Create a new object

Parameters:
tablemap - the table map
de - directory entry
rar - input
Throws:
java.io.IOException - if an IO-error occurs
Method Detail

getShortcut

public java.lang.String getShortcut()
Returns the table shortcut.

Specified by:
getShortcut in interface XtfTable
Returns:
Returns the table shortcut.
See Also:
XtfTable.getShortcut()

getType

public int getType()
Get the table type, as a table directory value.

Specified by:
getType in interface XtfTable
Returns:
Returns the table type

lookupType

public java.lang.String lookupType(int type)
Returns the name of the lookup type (The start index is 1!).

Specified by:
lookupType in interface LookupTableFactory
Parameters:
type - The type.
Returns:
Returns the name of the lookup type.
See Also:
LookupTableFactory.lookupType(int)

read

public XtfLookupTable read(RandomAccessR rar,
                           int posOffset,
                           int type,
                           int offset,
                           XtfGlyphName xtfGlyph)
                    throws java.io.IOException
Read the LookupTable or null, if not found.

Type:

  • 1 - Single - Replace one glyph with one glyph
  • 2 - Multiple - Replace one glyph with more than one glyph
  • 3 - Alternate - Replace one glyph with one of many glyphs
  • 4 - Ligature - Replace multiple glyphs with one glyph
  • 5 - Context - Replace one or more glyphs in context
  • 6 - Chaining - Context Replace one or more glyphs in chained context
  • Specified by:
    read in interface LookupTableFactory
    Parameters:
    rar - The input.
    posOffset - The offset of the pos table (GPOS, GSUB).
    type - The table type.
    offset - The offset.
    xtfGlyph - The glyph name.
    Returns:
    Returns the table.
    Throws:
    java.io.IOException - if a io-error occurred.
    See Also:
    LookupTableFactory.read(org.extex.util.file.random.RandomAccessR, int, int, int, org.extex.font.format.xtf.tables.XtfGlyphName)