org.extex.font.format.xtf.tables.gps
Class XtfScriptList

java.lang.Object
  extended by org.extex.font.format.xtf.tables.gps.XtfScriptList
All Implemented Interfaces:
XMLWriterConvertible

public class XtfScriptList
extends java.lang.Object
implements XMLWriterConvertible

ScriptList.

ScriptList table

Type Name Description
uint16 ScriptCount Number of ScriptRecords
struct ScriptRecord
[ScriptCount]
Array of ScriptRecords
-listed alphabetically by ScriptTag

ScriptRecord

Type Name Description
Tag ScriptTag 4-byte ScriptTag identifier
Offset Script Offset to Script table-from beginning of ScriptList

Script Table and Language System Record

A Script table identifies each language system that defines how to use the glyphs in a script for a particular language. It also references a default language system that defines how to use the script's glyphs in the absence of language-specific knowledge.
A Script table begins with an offset to the Default Language System table (DefaultLangSys), which defines the set of features that regulate the default behavior of the script. Next, Language System Count (LangSysCount) defines the number of language systems (excluding the DefaultLangSys) that use the script. In addition, an array of Language System Records (LangSysRecord) defines each language system (excluding the default) with an identification tag (LangSysTag) and an offset to a Language System table (LangSys). The LangSysRecord array stores the records alphabetically by LangSysTag.
If no language-specific script behavior is defined, the LangSysCount is set to zero (0), and no LangSysRecords are allocated.

ScriptList table

Type Name Description
uint16 ScriptCount Number of ScriptRecords
struct ScriptRecord
[ScriptCount]
Array of ScriptRecords
-listed alphabetically by ScriptTag

Version:
$Revision: 6604 $
Author:
Michael Niedermair

Nested Class Summary
 class XtfScriptList.LangSys
          The class for a langsys.
 class XtfScriptList.LangSysRecord
          The class for a langsysrecord.
 class XtfScriptList.Record
          The class for a Record.
 class XtfScriptList.Script
          Script
 
Constructor Summary
XtfScriptList(RandomAccessR rar, int offset, AbstractXtfSFLTable gsub)
          Create a new object
 
Method Summary
 XtfScriptList.LangSys findLangSys(ScriptTag tag, LanguageSystemTag language)
          Find the LangSys in a script or null, if not found.
 XtfScriptList.Script findScript(ScriptTag tag)
          Find a script.
 int getCount()
          Returns the scriptcount
 XtfScriptList.Record getRecord(int i)
          Returns the script record.
 java.lang.String getRecordTag(int idx)
          Returns the record tag name.
static java.lang.String tag2String(int tag)
          Convert the tag value to a string.
 java.lang.String toString()
          Returns the info for this class
 void writeXML(XMLStreamWriter writer)
          Write the data to a XMLStreamWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XtfScriptList

public XtfScriptList(RandomAccessR rar,
                     int offset,
                     AbstractXtfSFLTable gsub)
              throws java.io.IOException
Create a new object

Parameters:
rar - input
offset - offset
gsub - The gsub table.
Throws:
java.io.IOException - if an IO-error occurs
Method Detail

tag2String

public static java.lang.String tag2String(int tag)
Convert the tag value to a string.

Parameters:
tag - The tag as int value.
Returns:
Return the tag string.

findLangSys

public XtfScriptList.LangSys findLangSys(ScriptTag tag,
                                         LanguageSystemTag language)
Find the LangSys in a script or null, if not found.

Parameters:
tag - The Tag for the script.
language - The language.
Returns:
Find the LangSys in a script or null, if not found.

findScript

public XtfScriptList.Script findScript(ScriptTag tag)
Find a script.

If no one is found, the 'DFLT' script is returned or null, if the default script not exists.

Parameters:
tag - The tag for the script
Returns:
Returns the script.

getCount

public int getCount()
Returns the scriptcount

Returns:
Returns the scriptcount

getRecord

public XtfScriptList.Record getRecord(int i)
Returns the script record.

Parameters:
i - the number
Returns:
Returns the script record

getRecordTag

public java.lang.String getRecordTag(int idx)
Returns the record tag name.

Parameters:
idx - The index.
Returns:
Returns the record tag name.

toString

public java.lang.String toString()
Returns the info for this class

Overrides:
toString in class java.lang.Object
Returns:
Returns the info for this class

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)