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

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

public class TtfTableHEAD
extends AbstractXtfTable
implements XtfTable, XMLWriterConvertible

The 'head' table contains global information about the font. It records such facts as the font version number, the creation and modification dates, revision number and basic typographic data that applies to the font as a whole. This includes a specification of the font bounding box, the direction in which the font's glyphs are most likely to be written and other information about the placement of glyphs in the em square.

Type Name Description
Fixed Table version number 0x00010000 for version 1.0.
Fixed fontRevision Set by font manufacturer.
ULONG checkSumAdjustment To compute: set it to 0, sum the entire font as ULONG, then store 0xB1B0AFBA - sum.
ULONG magicNumber Set to 0x5F0F3CF5.
USHORT flags

Bit 0 - baseline for font at y=0;

Bit 1 - left sidebearing at x=0;

Bit 2 - instructions may depend on point size;

Bit 3 - force ppem to integer values for all internal scaler math; may use fractional ppem sizes if this bit is clear;

Bit 4 - instructions may alter advance width (the advance widths might not scale linearly);

Note: All other bits must be zero.

USHORT unitsPerEm Valid range is from 16 to 16384
longDateTime created International date (8-byte field).
longDateTime modified International date (8-byte field).
FWord xMin For all glyph bounding boxes.
FWord yMin For all glyph bounding boxes.
FWord xMax For all glyph bounding boxes.
FWord yMax For all glyph bounding boxes.
USHORT macStyle Bit 0 bold (if set to 1); Bit 1 italic (if set to 1)
Bits 2-15 reserved (set to 0).
USHORT lowestRecPPEM Smallest readable size in pixels.
SHORT fontDirectionHint

0 Fully mixed directional glyphs;

1 Only strongly left to right;

2 Like 1 but also contains neutrals 1;

-1 Only strongly right to left;

-2 Like -1 but also contains neutrals.

SHORT indexToLocFormat 0 for short offsets, 1 for long.
SHORT glyphDataFormat 0 for current format.

Version:
$Revision: 6604 $
Author:
Michael Niedermair

Constructor Summary
TtfTableHEAD(XtfTableMap tablemap, XtfTableDirectory.Entry de, RandomAccessR rar)
          Create a new object.
 
Method Summary
 int getCheckSumAdjustment()
          Returns the checkSumAdjustment.
 long getCreated()
          Returns the created.
 short getFlags()
          Returns the flags.
 short getFontDirectionHint()
          Returns the fontDirectionHint.
 Fixed32 getFontRevision()
          Returns the fontRevision.
 short getGlyphDataFormat()
          Returns the glyphDataFormat.
 short getIndexToLocFormat()
          Returns the indexToLocFormat.
 short getLowestRecPPEM()
          Returns the lowestRecPPEM.
 short getMacStyle()
          Returns the macStyle.
 int getMagicNumber()
          Returns the magicNumber.
 long getModified()
          Returns the modified.
 java.lang.String getShortcut()
          Returns the table shortcut.
 int getType()
          Get the table type, as a table directory value.
 short getUnitsPerEm()
          Returns the unitsPerEm.
 int getVersion()
          Returns the version.
 short getXMax()
          Returns the xMax.
 short getXMin()
          Returns the xMin.
 short getYMax()
          Returns the yMax.
 short getYMin()
          Returns the yMin.
 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
 

Constructor Detail

TtfTableHEAD

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

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

getCheckSumAdjustment

public int getCheckSumAdjustment()
Returns the checkSumAdjustment.

Returns:
Returns the checkSumAdjustment.

getCreated

public long getCreated()
Returns the created.

Returns:
Returns the created.

getFlags

public short getFlags()
Returns the flags.

Returns:
Returns the flags.

getFontDirectionHint

public short getFontDirectionHint()
Returns the fontDirectionHint.

Returns:
Returns the fontDirectionHint.

getFontRevision

public Fixed32 getFontRevision()
Returns the fontRevision.

Returns:
Returns the fontRevision.

getGlyphDataFormat

public short getGlyphDataFormat()
Returns the glyphDataFormat.

Returns:
Returns the glyphDataFormat.

getIndexToLocFormat

public short getIndexToLocFormat()
Returns the indexToLocFormat.

Returns:
Returns the indexToLocFormat.

getLowestRecPPEM

public short getLowestRecPPEM()
Returns the lowestRecPPEM.

Returns:
Returns the lowestRecPPEM.

getMacStyle

public short getMacStyle()
Returns the macStyle.

Returns:
Returns the macStyle.

getMagicNumber

public int getMagicNumber()
Returns the magicNumber.

Returns:
Returns the magicNumber.

getModified

public long getModified()
Returns the modified.

Returns:
Returns the modified.

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

getUnitsPerEm

public short getUnitsPerEm()
Returns the unitsPerEm.

Returns:
Returns the unitsPerEm.

getVersion

public int getVersion()
Returns the version.

Returns:
Returns the version.

getXMax

public short getXMax()
Returns the xMax.

Returns:
Returns the xMax.

getXMin

public short getXMin()
Returns the xMin.

Returns:
Returns the xMin.

getYMax

public short getYMax()
Returns the yMax.

Returns:
Returns the yMax.

getYMin

public short getYMin()
Returns the yMin.

Returns:
Returns the yMin.

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)