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

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

public class TtfTableNAME
extends AbstractXtfTable
implements XtfTable, XMLWriterConvertible

The name table(tag name: 'name') allows you to include human-readable names for features and settings, copyright notices, font names, style names, and other information related to your font.

Type Name Description
UInt16 format Format selector. Set to 0.
UInt16 count The number of nameRecords in this name table.
UInt16 stringOffset Offset in bytes to the beginning of the name character strings.
NameRecord nameRecord[count] The name records array.
variable name character strings The character strings of the names. Note that these are not necessarily ASCII!

Version:
$Revision: 6604 $
Author:
Michael Niedermair

Nested Class Summary
 class TtfTableNAME.NameRecord
          NameRecord.
 
Field Summary
static short APPLE_UNICODE
          platform apple unicode.
static short COPYRIGHTNOTICE
          ID: COPYRIGHTNOTICE.
static short FONTFAMILYNAME
          ID: FONTFAMILYNAME.
static short FONTSUBFAMILYNAME
          ID: FONTSUBFAMILYNAME.
static short FULLFONTNAME
          ID: FULLFONTNAME.
static java.lang.String[] IDNAME
          ID - name.
static short ISO
          platform iso.
static short MACINTOSH
          platform macintosh.
static short MICROSOFT
          platform microsoft.
static java.lang.String[] PLATFORMNAME
          platform names.
static short POSTSCRIPTNAME
          ID: POSTSCRIPTNAME.
static short TRADEMARK
          ID: TRADEMARK.
static short UNIQUEFONTIDENTIFIER
          ID: UNIQUEFONTIDENTIFIER.
static short VERSIONSTRING
          ID: VERSIONSTRING.
 
Constructor Summary
TtfTableNAME(XtfTableMap tablemap, XtfTableDirectory.Entry de, RandomAccessR rar)
          Create a new object.
 
Method Summary
 boolean existsPlatfrom(int platfromid)
          Check, if a record for the platform exists.
 short getCount()
          Returns the count.
 short getFormat()
          Returns the format.
static java.lang.String getIdName(int id)
          Returns the name for a id.
 TtfTableNAME.NameRecord[] getNameRecords()
          Returns the name records.
 TtfTableNAME.NameRecord[] getNameRecords(int platfromid)
          Returns the name records for a platform id.
 int[] getPlatformIDs()
          Returns the platform ids.
static java.lang.String getPlatformName(int id)
          Returns the platform name for a id.
 java.lang.String getRecord(short nameId)
          Returns the record.
 java.lang.String getRecordString(int platfromid, int id)
          Returns the name records for a platform id.
 java.lang.String getShortcut()
          Returns the table shortcut.
 short getStringOffset()
          Returns the stringOffset.
 int getType()
          Get the table type, as a table directory value.
 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

APPLE_UNICODE

public static final short APPLE_UNICODE
platform apple unicode.

See Also:
Constant Field Values

COPYRIGHTNOTICE

public static final short COPYRIGHTNOTICE
ID: COPYRIGHTNOTICE.

See Also:
Constant Field Values

FONTFAMILYNAME

public static final short FONTFAMILYNAME
ID: FONTFAMILYNAME.

See Also:
Constant Field Values

FONTSUBFAMILYNAME

public static final short FONTSUBFAMILYNAME
ID: FONTSUBFAMILYNAME.

See Also:
Constant Field Values

FULLFONTNAME

public static final short FULLFONTNAME
ID: FULLFONTNAME.

See Also:
Constant Field Values

IDNAME

public static final java.lang.String[] IDNAME
ID - name.


ISO

public static final short ISO
platform iso.

See Also:
Constant Field Values

MACINTOSH

public static final short MACINTOSH
platform macintosh.

See Also:
Constant Field Values

MICROSOFT

public static final short MICROSOFT
platform microsoft.

See Also:
Constant Field Values

PLATFORMNAME

public static final java.lang.String[] PLATFORMNAME
platform names.


POSTSCRIPTNAME

public static final short POSTSCRIPTNAME
ID: POSTSCRIPTNAME.

See Also:
Constant Field Values

TRADEMARK

public static final short TRADEMARK
ID: TRADEMARK.

See Also:
Constant Field Values

UNIQUEFONTIDENTIFIER

public static final short UNIQUEFONTIDENTIFIER
ID: UNIQUEFONTIDENTIFIER.

See Also:
Constant Field Values

VERSIONSTRING

public static final short VERSIONSTRING
ID: VERSIONSTRING.

See Also:
Constant Field Values
Constructor Detail

TtfTableNAME

public TtfTableNAME(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 occurs
Method Detail

getIdName

public static java.lang.String getIdName(int id)
Returns the name for a id.

Parameters:
id - The name id.
Returns:
Returns the name name for a id.

getPlatformName

public static java.lang.String getPlatformName(int id)
Returns the platform name for a id.

Parameters:
id - The platform id.
Returns:
Returns the platform name for a id.

existsPlatfrom

public boolean existsPlatfrom(int platfromid)
Check, if a record for the platform exists.

Parameters:
platfromid - The platform id.
Returns:
Returns true, if a record for the platform exists.

getCount

public short getCount()
Returns the count. The number of nameRecords in this name table.

Returns:
Returns the count.

getFormat

public short getFormat()
Returns the format.

Returns:
Returns the format.

getNameRecords

public TtfTableNAME.NameRecord[] getNameRecords()
Returns the name records.

Returns:
Returns the name records.

getNameRecords

public TtfTableNAME.NameRecord[] getNameRecords(int platfromid)
Returns the name records for a platform id.

Parameters:
platfromid - The platform id.
Returns:
Returns the name records for a platform id.

getPlatformIDs

public int[] getPlatformIDs()
Returns the platform ids.

Returns:
Returns the platform ids.

getRecord

public java.lang.String getRecord(short nameId)
Returns the record.

Parameters:
nameId - name id
Returns:
Returns the record.

getRecordString

public java.lang.String getRecordString(int platfromid,
                                        int id)
Returns the name records for a platform id.

Parameters:
platfromid - The platform id.
id - TODO mgn
Returns:
Returns the name records for a platform id.

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

getStringOffset

public short getStringOffset()
Returns the stringOffset.

Returns:
Returns the stringOffset.

getType

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

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

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)