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

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

public class TtfTablePOST
extends AbstractXtfTable
implements XtfTable, XMLWriterConvertible

The 'post' table contains information needed to use a TrueType font on a PostScript printer. It contains the data needed for the FontInfo dictionary entry as well as the PostScript names for all of the glyphs in the font. It also contains memory usage information needed by the PostScript driver for memory management.

Type Name Description
Fixed Format Type 0x00010000 for format 1.0, 0x00020000 for format 2.0, and so on
Fixed italicAngle Italic angle in counter-clockwise degrees from the vertical. Zero for upright text, negative for text that leans to the right (forward)
FWord underlinePosition Suggested values for the underline position (negative values indicate below baseline).
FWord underlineThickness Suggested values for the underline thickness.
ULONG isFixedPitch Set to 0 if the font is proportionally spaced, non-zero if the font is not proportionally spaced (i.e. monospaced).
ULONG minMemType42 Minimum memory usage when a TrueType font is downloaded.
ULONG maxMemType42 Maximum memory usage when a TrueType font is downloaded.
ULONG minMemType1 Minimum memory usage when a TrueType font is downloaded as a Type 1 font.
ULONG maxMemType1 Maximum memory usage when a TrueType font is downloaded as a Type 1 font.

Format 2

Type Name Description
uint16 numberOfGlyphs number of glyphs
uint16 glyphNameIndex[numberOfGlyphs] Ordinal number of this glyph in 'post' string tables. This is not an offset.
Pascal string names[numberNewGlyphs] glyph names with length bytes [variable] (a Pascal string)

Format 3

This version is used by OpenType fonts with TrueType or CFF data. The version makes it possible to create a special font that is not burdened with a large 'post' table set of glyph names.

This version specifies that no PostScript name information is provided for the glyphs in this font file. The printing behavior of this version on PostScript printers is unspecified, except that it should not result in a fatal or unrecoverable error. Some drivers may print nothing, other drivers may attempt to print using a default naming scheme.

Version:
$Revision: 6737 $
Author:
Michael Niedermair

Field Summary
static int FORMAT1
          Format 1.
static int FORMAT2
          Format 2.
static int FORMAT25
          Format 2.5.
static int FORMAT3
          Format 3.
static int FORMAT4
          Format 4.
 
Constructor Summary
TtfTablePOST(XtfTableMap tablemap, XtfTableDirectory.Entry de, RandomAccessR rar)
          Create a new object.
 
Method Summary
 java.lang.String getGlyphName(int i)
          Returns the glyph name.
 int[] getGlyphNameIndex()
          Returns the glyphNameIndex.
 int getGlyphNamePosition(java.lang.String glypname)
          Returns the position of a glpyhname or -1 if not found.
 int getGlyphValue(int id)
          Returns the int-value for a glyph.
 int getIsFixedPitch()
          Returns the isFixedPitch.
 int getItalicAngle()
          Returns the italicAngle.
 int getMaxMemType1()
          Returns the maxMemType1.
 int getMaxMemType42()
          Returns the maxMemType42.
 int getMinMemType1()
          Returns the minMemType1.
 int getMinMemType42()
          Returns the minMemType42.
 int getNumGlyphs()
          Returns the numGlyphs.
 java.lang.String[] getPsGlyphName()
          Returns the psGlyphName.
 java.lang.String getShortcut()
          Returns the table shortcut.
 int getType()
          Get the table type, as a table directory value.
 short getUnderlinePosition()
          Returns the underlinePosition.
 short getUnderlineThickness()
          Returns the underlineThickness.
 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
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

FORMAT1

public static final int FORMAT1
Format 1.

See Also:
Constant Field Values

FORMAT2

public static final int FORMAT2
Format 2.

See Also:
Constant Field Values

FORMAT25

public static final int FORMAT25
Format 2.5.

See Also:
Constant Field Values

FORMAT3

public static final int FORMAT3
Format 3.

See Also:
Constant Field Values

FORMAT4

public static final int FORMAT4
Format 4.

See Also:
Constant Field Values
Constructor Detail

TtfTablePOST

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

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

getGlyphName

public java.lang.String getGlyphName(int i)
Returns the glyph name.

Specified by:
getGlyphName in interface XtfGlyphName
Overrides:
getGlyphName in class AbstractXtfTable
Parameters:
i - index
Returns:
Returns the glyph name

getGlyphNameIndex

public int[] getGlyphNameIndex()
Returns the glyphNameIndex.

Returns:
Returns the glyphNameIndex.

getGlyphNamePosition

public int getGlyphNamePosition(java.lang.String glypname)
Returns the position of a glpyhname or -1 if not found.

Parameters:
glypname - The glpyh name.
Returns:
Returns the position of a glpyhname.

getGlyphValue

public int getGlyphValue(int id)
Returns the int-value for a glyph.

Parameters:
id - the id for the glyph
Returns:
Returns the int-value for a glyph.

getIsFixedPitch

public int getIsFixedPitch()
Returns the isFixedPitch.

Returns:
Returns the isFixedPitch.

getItalicAngle

public int getItalicAngle()
Returns the italicAngle.

Returns:
Returns the italicAngle.

getMaxMemType1

public int getMaxMemType1()
Returns the maxMemType1.

Returns:
Returns the maxMemType1.

getMaxMemType42

public int getMaxMemType42()
Returns the maxMemType42.

Returns:
Returns the maxMemType42.

getMinMemType1

public int getMinMemType1()
Returns the minMemType1.

Returns:
Returns the minMemType1.

getMinMemType42

public int getMinMemType42()
Returns the minMemType42.

Returns:
Returns the minMemType42.

getNumGlyphs

public int getNumGlyphs()
Returns the numGlyphs.

Returns:
Returns the numGlyphs.

getPsGlyphName

public java.lang.String[] getPsGlyphName()
Returns the psGlyphName.

Returns:
Returns the psGlyphName.

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:
The table type

getUnderlinePosition

public short getUnderlinePosition()
Returns the underlinePosition.

Returns:
Returns the underlinePosition.

getUnderlineThickness

public short getUnderlineThickness()
Returns the underlineThickness.

Returns:
Returns the underlineThickness.

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)