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

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

public class TtfTableOS2
extends AbstractXtfTable
implements XtfTable, XMLWriterConvertible

The 'OS/2' table consists of a set of metrics that are required by OS/2 and Windows. It is not used by the Mac OS.

Type Name of Entry Comments
USHORT version table version number (set to 0)
SHORT xAvgCharWidth; average weighted advance width of lower case letters and space
USHORT usWeightClass; visual weight (degree of blackness or thickness) of stroke in glyphs
USHORT usWidthClass; relative change from the normal aspect ratio (width to height ratio) as specified by a font designer for the glyphs in the font
SHORT fsType; characteristics and properties of this font (set undefined bits to zero)
SHORT ySubscriptXSize; recommended horizontal size in pixels for subscripts
SHORT ySubscriptYSize; recommended vertical size in pixels for subscripts
SHORT ySubscriptXOffset; recommended horizontal offset for subscripts
SHORT ySubscriptYOffset; recommended vertical offset form the baseline for subscripts
SHORT ySuperscriptXSize; recommended horizontal size in pixels for superscripts
SHORT ySuperscriptYSize; recommended vertical size in pixels for superscripts
SHORT ySuperscriptXOffset; recommended horizontal offset for superscripts
SHORT ySuperscriptYOffset; recommended vertical offset from the baseline for superscripts
SHORT yStrikeoutSize; width of the strikeout stroke
SHORT yStrikeoutPosition; position of the strikeout stroke relative to the baseline
SHORT sFamilyClass; classification of font-family design.
PANOSE panose; 10 byte series of number used to describe the visual characteristics of a given typeface
ULONG ulUnicodeRange1 Field is split into two bit fields of 96 and 36 bits each. The low 96 bits are used to specify the Unicode blocks encompassed by the font file. The high 32 bits are used to specify the character or script sets covered by the font file. Bit assignments are pending. Set to 0
Bits 0–31
ULONG ulUnicodeRange2 Bits 32–63
ULONG ulUnicodeRange3 Bits 64–95
ULONG ulUnicodeRange4 Bits 96–127
CHAR achVendID[4]; four character identifier for the font vendor
USHORT fsSelection; 2-byte bit field containing information concerning the nature of the font patterns
USHORT usFirstCharIndex The minimum Unicode index in this font.
USHORT usLastCharIndex The maximum Unicode index in this font.
USHORT sTypoAscender
USHORT sTypoDescender
USHORT sTypoLineGap
USHORT usWinAscent
USHORT usWinDescent
ULONG ulCodePageRange1 Bits 0-31
ULONG ulCodePageRange2 Bits 32-63

Version:
$Revision: 6604 $
Author:
Michael Niedermair

Nested Class Summary
static class TtfTableOS2.Panose
          panose.
 
Constructor Summary
TtfTableOS2(XtfTableMap tablemap, XtfTableDirectory.Entry de, RandomAccessR rar)
          Create a new object.
 
Method Summary
 int getAchVendorID()
          Returns the achVendorID.
 short getFsSelection()
          Returns the fsSelection.
 short getFsType()
          Returns the fsType.
 TtfTableOS2.Panose getPanose()
          Returns the panose.
 short getSFamilyClass()
          Returns the sFamilyClass.
 java.lang.String getShortcut()
          Returns the table shortcut.
 short getSTypoAscender()
          Returns the sTypoAscender.
 short getSTypoDescender()
          Returns the sTypoDescender.
 short getSTypoLineGap()
          Returns the sTypoLineGap.
 int getType()
          Get the table type, as a table directory value.
 int getUlCodePageRange1()
          Returns the ulCodePageRange1.
 int getUlCodePageRange2()
          Returns the ulCodePageRange2.
 int getUlUnicodeRange1()
          Returns the ulUnicodeRange1.
 int getUlUnicodeRange2()
          Returns the ulUnicodeRange2.
 int getUlUnicodeRange3()
          Returns the ulUnicodeRange3.
 int getUlUnicodeRange4()
          Returns the ulUnicodeRange4.
 int getUsFirstCharIndex()
          Returns the usFirstCharIndex.
 int getUsLastCharIndex()
          Returns the usLastCharIndex.
 int getUsWeightClass()
          Returns the usWeightClass.
 int getUsWidthClass()
          Returns the usWidthClass.
 int getUsWinAscent()
          Returns the usWinAscent.
 int getUsWinDescent()
          Returns the usWinDescent.
 int getVersion()
          Returns the version.
 short getXAvgCharWidth()
          Returns the xAvgCharWidth.
 short getYStrikeoutPosition()
          Returns the yStrikeoutPosition.
 short getYStrikeoutSize()
          Returns the yStrikeoutSize.
 short getYSubscriptXOffset()
          Returns the ySubscriptXOffset.
 short getYSubscriptXSize()
          Returns the ySubscriptXSize.
 short getYSubscriptYOffset()
          Returns the ySubscriptYOffset.
 short getYSubscriptYSize()
          Returns the ySubscriptYSize.
 short getYSuperscriptXOffset()
          Returns the ySuperscriptXOffset.
 short getYSuperscriptXSize()
          Returns the ySuperscriptXSize.
 short getYSuperscriptYOffset()
          Returns the ySuperscriptYOffset.
 short getYSuperscriptYSize()
          Returns the ySuperscriptYSize.
 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

TtfTableOS2

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

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

getAchVendorID

public int getAchVendorID()
Returns the achVendorID.

Returns:
Returns the achVendorID.

getFsSelection

public short getFsSelection()
Returns the fsSelection.

Returns:
Returns the fsSelection.

getFsType

public short getFsType()
Returns the fsType.

Returns:
Returns the fsType.

getPanose

public TtfTableOS2.Panose getPanose()
Returns the panose.

Returns:
Returns the panose.

getSFamilyClass

public short getSFamilyClass()
Returns the sFamilyClass.

Returns:
Returns the sFamilyClass.

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()

getSTypoAscender

public short getSTypoAscender()
Returns the sTypoAscender.

Returns:
Returns the sTypoAscender.

getSTypoDescender

public short getSTypoDescender()
Returns the sTypoDescender.

Returns:
Returns the sTypoDescender.

getSTypoLineGap

public short getSTypoLineGap()
Returns the sTypoLineGap.

Returns:
Returns the sTypoLineGap.

getType

public int getType()
Get the table type, as a table directory value.

Specified by:
getType in interface XtfTable
Returns:
Returns the table type

getUlCodePageRange1

public int getUlCodePageRange1()
Returns the ulCodePageRange1.

Returns:
Returns the ulCodePageRange1.

getUlCodePageRange2

public int getUlCodePageRange2()
Returns the ulCodePageRange2.

Returns:
Returns the ulCodePageRange2.

getUlUnicodeRange1

public int getUlUnicodeRange1()
Returns the ulUnicodeRange1.

Returns:
Returns the ulUnicodeRange1.

getUlUnicodeRange2

public int getUlUnicodeRange2()
Returns the ulUnicodeRange2.

Returns:
Returns the ulUnicodeRange2.

getUlUnicodeRange3

public int getUlUnicodeRange3()
Returns the ulUnicodeRange3.

Returns:
Returns the ulUnicodeRange3.

getUlUnicodeRange4

public int getUlUnicodeRange4()
Returns the ulUnicodeRange4.

Returns:
Returns the ulUnicodeRange4.

getUsFirstCharIndex

public int getUsFirstCharIndex()
Returns the usFirstCharIndex.

Returns:
Returns the usFirstCharIndex.

getUsLastCharIndex

public int getUsLastCharIndex()
Returns the usLastCharIndex.

Returns:
Returns the usLastCharIndex.

getUsWeightClass

public int getUsWeightClass()
Returns the usWeightClass.

Returns:
Returns the usWeightClass.

getUsWidthClass

public int getUsWidthClass()
Returns the usWidthClass.

Returns:
Returns the usWidthClass.

getUsWinAscent

public int getUsWinAscent()
Returns the usWinAscent.

Returns:
Returns the usWinAscent.

getUsWinDescent

public int getUsWinDescent()
Returns the usWinDescent.

Returns:
Returns the usWinDescent.

getVersion

public int getVersion()
Returns the version.

Returns:
Returns the version.

getXAvgCharWidth

public short getXAvgCharWidth()
Returns the xAvgCharWidth.

Returns:
Returns the xAvgCharWidth.

getYStrikeoutPosition

public short getYStrikeoutPosition()
Returns the yStrikeoutPosition.

Returns:
Returns the yStrikeoutPosition.

getYStrikeoutSize

public short getYStrikeoutSize()
Returns the yStrikeoutSize.

Returns:
Returns the yStrikeoutSize.

getYSubscriptXOffset

public short getYSubscriptXOffset()
Returns the ySubscriptXOffset.

Returns:
Returns the ySubscriptXOffset.

getYSubscriptXSize

public short getYSubscriptXSize()
Returns the ySubscriptXSize.

Returns:
Returns the ySubscriptXSize.

getYSubscriptYOffset

public short getYSubscriptYOffset()
Returns the ySubscriptYOffset.

Returns:
Returns the ySubscriptYOffset.

getYSubscriptYSize

public short getYSubscriptYSize()
Returns the ySubscriptYSize.

Returns:
Returns the ySubscriptYSize.

getYSuperscriptXOffset

public short getYSuperscriptXOffset()
Returns the ySuperscriptXOffset.

Returns:
Returns the ySuperscriptXOffset.

getYSuperscriptXSize

public short getYSuperscriptXSize()
Returns the ySuperscriptXSize.

Returns:
Returns the ySuperscriptXSize.

getYSuperscriptYOffset

public short getYSuperscriptYOffset()
Returns the ySuperscriptYOffset.

Returns:
Returns the ySuperscriptYOffset.

getYSuperscriptYSize

public short getYSuperscriptYSize()
Returns the ySuperscriptYSize.

Returns:
Returns the ySuperscriptYSize.

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)