org.extex.font.format.xtf.tables
Class TtfTableGASP

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

public class TtfTableGASP
extends AbstractXtfTable
implements XtfTable, XMLWriterConvertible

The table 'gasp'.

This table contains information which describes the preferred rasterization techniques for the typeface when it is rendered on grayscale-capable devices. This table also has some use for monochrome devices, which may use the table to turn off hinting at very large or small sizes, to improve performance.

Type Name Description
USHORT version Version number (set to 0)
USHORT numRanges Number of records to follow
GASPRANGE gaspRange[numRanges] Sorted by ppem

GASPRANGE

Type Name Description
USHORT rangeMaxPPEM Upper limit of range, in PPEM
USHORT rangeGaspBehavior Flags describing desired rasterizer behavior.

There are two flags for the rangeGaspBehavior flags:

Flag Meaning
GASP_GRIDFIT Use gridfitting
GASP_DOGRAY Use grayscale rendering

The four currently defined values of rangeGaspBehavior would have the following uses:

Flag Value Meaning
GASP_DOGRAY 0x0002 small sizes, typically ppem<9
GASP_GRIDFIT 0x0001 medium sizes, typically 9<=ppem<=16
GASP_DOGRAY|GASP_GRIDFIT 0x0003 large sizes, typically ppem>16
(neither) 0x0000 optional for very large sizes, typically ppem>2048

The records in the gaspRange[] array must be sorted in order of increasing rangeMaxPPEM value. The last record should use 0xFFFF as a sentinel value for rangeMaxPPEM and should describe the behavior desired at all sizes larger than the previous record's upper limit. If the only entry in 'gasp' is the 0xFFFF sentinel value, the behavior described will be used for all sizes.

Version:
$Revision: 6604 $
Author:
Michael Niedermair

Nested Class Summary
 class TtfTableGASP.GaspRange
          GaspRange
 
Field Summary
static int GASP_DOGRAY
          GASP_DOGRAY
static int GASP_DOGRAY_GRIDFIT
          GASP_DOGRAY_GRIDFIT
static int GASP_GRIDFIT
          GASP_GRIDFIT
static int GASP_NONE
          GASP_NONE
 
Constructor Summary
TtfTableGASP(XtfTableMap tablemap, XtfTableDirectory.Entry de, RandomAccessR rar)
          Create a new object
 
Method Summary
 TtfTableGASP.GaspRange[] getGaspRange()
          Returns the gaspRange.
 int getNumRanges()
          Returns the numRanges.
 java.lang.String getShortcut()
          Returns the table shortcut.
 int getType()
          Get the table type, as a table directory value.
 int getVersion()
          Returns the version.
 void writeXML(XMLStreamWriter writer)
          Write the data to a XMLStreamWriter.
 
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
 

Field Detail

GASP_DOGRAY

public static final int GASP_DOGRAY
GASP_DOGRAY

See Also:
Constant Field Values

GASP_DOGRAY_GRIDFIT

public static final int GASP_DOGRAY_GRIDFIT
GASP_DOGRAY_GRIDFIT

See Also:
Constant Field Values

GASP_GRIDFIT

public static final int GASP_GRIDFIT
GASP_GRIDFIT

See Also:
Constant Field Values

GASP_NONE

public static final int GASP_NONE
GASP_NONE

See Also:
Constant Field Values
Constructor Detail

TtfTableGASP

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

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

getGaspRange

public TtfTableGASP.GaspRange[] getGaspRange()
Returns the gaspRange.

Returns:
Returns the gaspRange.

getNumRanges

public int getNumRanges()
Returns the numRanges.

Returns:
Returns the numRanges.

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

getVersion

public int getVersion()
Returns the version.

Returns:
Returns the version.

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)