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

java.lang.Object
  extended by org.extex.font.format.xtf.tables.gps.XtfLookup
All Implemented Interfaces:
XMLWriterConvertible

public class XtfLookup
extends java.lang.Object
implements XMLWriterConvertible

Lookup tables provide a way of looking up information about a glyph index.

Some lookup tables do simple array-type lookup. Others involve groupings, allowing you to treat many different glyph indexes in the same way (that is, to look up the same information about them). The top-level description of a lookup table contains a format number and a format-specific header.

The format of the Lookup Table header is as follows:

Type Name Description
uint16 format Format of this lookup table. There are five lookup table formats, each with a format number.
variable fsHeader Format-specific header (each of these is described in the following sections), followed by the actual lookup data. The details of the fsHeader structure are given with the different formats.

Version:
$Revision: 7274 $
Author:
Michael Niedermair

Field Summary
static int FLAG_IGNORE_BASE_GLYPHS
          If set, skips over base glyphs.
static int FLAG_IGNORE_BASE_LIGATURES
          If set, skips over ligatures.
static int FLAG_IGNORE_BASE_MARKS
          If set, skips over combining marks.
static int FLAG_MARK_ATTACHMENT_TYPE
          If not zero, skips over all marks of attachment type different from specified.
static int FLAG_RESERVED
          For future use.
static int FLAG_RIGHT_TO_LEFT
          This bit relates only to the correct processing of the cursive attachment lookup type (GPOS lookup type 3).
static int GPOS_1_SINGLE
          1 - Single adjustment -Adjust position of a single glyph
static int GPOS_2_PAIR
          2 - Pair adjustment - Adjust position of a pair of glyphs
static int GPOS_3_CURSIVE_ATTACHMENT
          3 - Cursive attachment - Attach cursive glyphs
static int GPOS_4_MARKTOBASE_ATTACHMENT
          4 - MarkToBase attachment - Attach a combining mark to a base glyph
static int GPOS_5_MARKTOLIGATURE_ATTACHMENT
          5 - MarkToLigature attachment - Attach a combining mark to a ligature
static int GPOS_6_MARKTOMARK_ATTACHMENT
          6 - MarkToMark attachment - Attach a combining mark to another mark
static int GPOS_7_CONTEXT_POSITIONING
          7 - Context positioning - Position one or more glyphs in context
static int GPOS_8_CHAINED_CONTEXT_POSITIONING
          8 - Chained Context positioning - Position one or more glyphs in chained context
static int GPOS_9_EXTENSION_POSITIONING
          9 - Extension positioning - Extension mechanism for other positionings
static int GSUB_1_SINGLE
          1 - Single - Replace one glyph with one glyph
static int GSUB_2_MULTIPLE
          2 - Multiple - Replace one glyph with more than one glyph
static int GSUB_3_ALTERNATE
          3 - Alternate - Replace one glyph with one of many glyphs
static int GSUB_4_LIGATURE
          4 - Ligature - Replace multiple glyphs with one glyph
static int GSUB_5_CONTEXT
          5 - Context - Replace one or more glyphs in context
static int GSUB_6_CHAINING_CONTEXTUAL
          6 - Chaining - Context Replace one or more glyphs in chained context
static int GSUB_7_EXTENSION
          7 - Extension Substitution - Extension mechanism for other substitutions (i.e.
static int GSUB_8_REVERSE_CHAINING_CONTEXT_SINGLE
          8 - Reverse chaining context single - Applied in reverse order, replace single glyph in chaining context
static java.lang.String[] LOOKUP_TYPE_NAMES_GPOS
          The name of the lookup types (GPOS).
static java.lang.String[] LOOKUP_TYPE_NAMES_GSUB
          The name of the lookup types (GSUB).
 
Constructor Summary
XtfLookup(RandomAccessR rar, int posOffset, int offset, LookupTableFactory lookupFactory, int index, XtfGlyphName xtfGlyph)
          Create a new object
 
Method Summary
 int getIndex()
          Getter for index.
 XtfLookupTable getSubtable(int i)
          Returns the subtable
 int getSubtableCount()
          Returns the subtable count
 int getType()
          Returns the type
 java.lang.String getTypeAsString()
          Returns the type as string.
 java.lang.String toString()
          Returns the info for this class
 void writeXML(XMLStreamWriter writer)
          Write the data to a XMLStreamWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FLAG_IGNORE_BASE_GLYPHS

public static final int FLAG_IGNORE_BASE_GLYPHS
If set, skips over base glyphs.

See Also:
Constant Field Values

FLAG_IGNORE_BASE_LIGATURES

public static final int FLAG_IGNORE_BASE_LIGATURES
If set, skips over ligatures.

See Also:
Constant Field Values

FLAG_IGNORE_BASE_MARKS

public static final int FLAG_IGNORE_BASE_MARKS
If set, skips over combining marks.

See Also:
Constant Field Values

FLAG_MARK_ATTACHMENT_TYPE

public static final int FLAG_MARK_ATTACHMENT_TYPE
If not zero, skips over all marks of attachment type different from specified.

See Also:
Constant Field Values

FLAG_RESERVED

public static final int FLAG_RESERVED
For future use.

See Also:
Constant Field Values

FLAG_RIGHT_TO_LEFT

public static final int FLAG_RIGHT_TO_LEFT
This bit relates only to the correct processing of the cursive attachment lookup type (GPOS lookup type 3). When this bit is set, the last glyph in a given sequence to which the cursive attachment lookup is applied, will be positioned on the baseline. Note: Setting of this bit is not intended to be used by operating systems or applications to determine text direction.

See Also:
Constant Field Values

GPOS_1_SINGLE

public static final int GPOS_1_SINGLE
1 - Single adjustment -Adjust position of a single glyph

See Also:
Constant Field Values

GPOS_2_PAIR

public static final int GPOS_2_PAIR
2 - Pair adjustment - Adjust position of a pair of glyphs

See Also:
Constant Field Values

GPOS_3_CURSIVE_ATTACHMENT

public static final int GPOS_3_CURSIVE_ATTACHMENT
3 - Cursive attachment - Attach cursive glyphs

See Also:
Constant Field Values

GPOS_4_MARKTOBASE_ATTACHMENT

public static final int GPOS_4_MARKTOBASE_ATTACHMENT
4 - MarkToBase attachment - Attach a combining mark to a base glyph

See Also:
Constant Field Values

GPOS_5_MARKTOLIGATURE_ATTACHMENT

public static final int GPOS_5_MARKTOLIGATURE_ATTACHMENT
5 - MarkToLigature attachment - Attach a combining mark to a ligature

See Also:
Constant Field Values

GPOS_6_MARKTOMARK_ATTACHMENT

public static final int GPOS_6_MARKTOMARK_ATTACHMENT
6 - MarkToMark attachment - Attach a combining mark to another mark

See Also:
Constant Field Values

GPOS_7_CONTEXT_POSITIONING

public static final int GPOS_7_CONTEXT_POSITIONING
7 - Context positioning - Position one or more glyphs in context

See Also:
Constant Field Values

GPOS_8_CHAINED_CONTEXT_POSITIONING

public static final int GPOS_8_CHAINED_CONTEXT_POSITIONING
8 - Chained Context positioning - Position one or more glyphs in chained context

See Also:
Constant Field Values

GPOS_9_EXTENSION_POSITIONING

public static final int GPOS_9_EXTENSION_POSITIONING
9 - Extension positioning - Extension mechanism for other positionings

See Also:
Constant Field Values

GSUB_1_SINGLE

public static final int GSUB_1_SINGLE
1 - Single - Replace one glyph with one glyph

See Also:
Constant Field Values

GSUB_2_MULTIPLE

public static final int GSUB_2_MULTIPLE
2 - Multiple - Replace one glyph with more than one glyph

See Also:
Constant Field Values

GSUB_3_ALTERNATE

public static final int GSUB_3_ALTERNATE
3 - Alternate - Replace one glyph with one of many glyphs

See Also:
Constant Field Values

GSUB_4_LIGATURE

public static final int GSUB_4_LIGATURE
4 - Ligature - Replace multiple glyphs with one glyph

See Also:
Constant Field Values

GSUB_5_CONTEXT

public static final int GSUB_5_CONTEXT
5 - Context - Replace one or more glyphs in context

See Also:
Constant Field Values

GSUB_6_CHAINING_CONTEXTUAL

public static final int GSUB_6_CHAINING_CONTEXTUAL
6 - Chaining - Context Replace one or more glyphs in chained context

See Also:
Constant Field Values

GSUB_7_EXTENSION

public static final int GSUB_7_EXTENSION
7 - Extension Substitution - Extension mechanism for other substitutions (i.e. this excludes the Extension type substitution itself)

See Also:
Constant Field Values

GSUB_8_REVERSE_CHAINING_CONTEXT_SINGLE

public static final int GSUB_8_REVERSE_CHAINING_CONTEXT_SINGLE
8 - Reverse chaining context single - Applied in reverse order, replace single glyph in chaining context

See Also:
Constant Field Values

LOOKUP_TYPE_NAMES_GPOS

public static final java.lang.String[] LOOKUP_TYPE_NAMES_GPOS
The name of the lookup types (GPOS).


LOOKUP_TYPE_NAMES_GSUB

public static final java.lang.String[] LOOKUP_TYPE_NAMES_GSUB
The name of the lookup types (GSUB).

Constructor Detail

XtfLookup

public XtfLookup(RandomAccessR rar,
                 int posOffset,
                 int offset,
                 LookupTableFactory lookupFactory,
                 int index,
                 XtfGlyphName xtfGlyph)
          throws java.io.IOException
Create a new object

Parameters:
rar - input
offset - offset
posOffset - The offset of the pos table (GSUB, GPOS).
lookupFactory - The factory for the lookup table.
index - The index.
xtfGlyph - The glyph name.
Throws:
java.io.IOException - if an IO-error occurs
Method Detail

getIndex

public int getIndex()
Getter for index.

Returns:
the index

getSubtable

public XtfLookupTable getSubtable(int i)
Returns the subtable

Parameters:
i - index
Returns:
Returns the subtable

getSubtableCount

public int getSubtableCount()
Returns the subtable count

Returns:
Returns the subtablecount

getType

public int getType()
Returns the type

Returns:
Returns the type

getTypeAsString

public java.lang.String getTypeAsString()
Returns the type as string.

Returns:
Returns the type as string.

toString

public java.lang.String toString()
Returns the info for this class

Overrides:
toString in class java.lang.Object
Returns:
Returns the info for this class

writeXML

public void writeXML(XMLStreamWriter writer)
              throws java.io.IOException
Write the data to a XMLStreamWriter.

Specified by:
writeXML in interface XMLWriterConvertible
Parameters:
writer - the XML-Writer
Throws:
java.io.IOException - if an IO-error occurs.
See Also:
XMLWriterConvertible.writeXML(org.extex.util.xml.XMLStreamWriter)