org.extex.font.format.xtf.tables.gps
Class XtfCoverage.CoverageFormat2

java.lang.Object
  extended by org.extex.font.format.xtf.tables.gps.XtfCoverage
      extended by org.extex.font.format.xtf.tables.gps.XtfCoverage.CoverageFormat2
All Implemented Interfaces:
XMLWriterConvertible
Enclosing class:
XtfCoverage

public static class XtfCoverage.CoverageFormat2
extends XtfCoverage

Coverage for FORMAT2.

Format 2 consists of a format code (CoverageFormat) and a count of glyph index ranges (RangeCount), followed by an array of records (RangeRecords). Each RangeRecord consists of a start glyph index (Start), an end glyph index (End), and the Coverage Index associated with the range's Start glyph. Ranges must be in GlyphID order, and they must be distinct, with no overlapping. The Coverage Indexes for the first range begin with zero (0), and the Start Coverage Indexes for each succeeding range are determined by adding the length of the preceding range (End GlyphID - Start GlyphID + 1) to the array Index. This allows for a quick calculation of the Coverage Index for any glyph in any range using the formula:

Coverage Index (GlyphID) = StartCoverageIndex + GlyphID - Start GlyphID.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.extex.font.format.xtf.tables.gps.XtfCoverage
XtfCoverage.CoverageFormat1, XtfCoverage.CoverageFormat2, XtfCoverage.RangeRecord
 
Method Summary
 int findGlyph(int glyphId)
          Returns the index of the glyph in the coverage table.
 int[] getGlyphs()
          Returns the glyphs from the coverage.
 void writeXML(XMLStreamWriter writer)
          Write the data to a XMLStreamWriter.
 
Methods inherited from class org.extex.font.format.xtf.tables.gps.XtfCoverage
getFormat, getXtfGlyph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findGlyph

public int findGlyph(int glyphId)
Returns the index of the glyph in the coverage table.

Specified by:
findGlyph in class XtfCoverage
Parameters:
glyphId - The ID of the glyph to find.
Returns:
Returns the index of the glyph within the coverage, or -1 if the glyph can't be found.
See Also:
XtfCoverage.findGlyph(int)

getGlyphs

public int[] getGlyphs()
Returns the glyphs from the coverage.

Specified by:
getGlyphs in class XtfCoverage
Returns:
Returns the glyphs from the coverage.
See Also:
XtfCoverage.getGlyphs()

writeXML

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

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