org.extex.font.format.xtf.tables
Class TtfTableCMAP.Format8

java.lang.Object
  extended by org.extex.font.format.xtf.tables.TtfTableCMAP.Format
      extended by org.extex.font.format.xtf.tables.TtfTableCMAP.Format8
All Implemented Interfaces:
XMLWriterConvertible
Enclosing class:
TtfTableCMAP

public class TtfTableCMAP.Format8
extends TtfTableCMAP.Format

Format 8.0 is a bit like format 2, in that it provides for mixed-length character codes. If a font contains Unicode surrogates, it's likely that it will also include other, regular 16-bit Unicodes as well. This requires a format to map a mixture of 16-bit and 32-bit character codes, just as format 2 allows a mixture of 8-bit and 16-bit codes. A simplifying assumption is made: namely, that there are no 32-bit character codes which share the same first 16 bits as any 16-bit character code. This means that the determination as to whether a particular 16-bit value is a standalone character code or the start of a 32-bit character code can be made by looking at the 16-bit value directly, with no further information required.

Type Name Description
Fixed32 format Subtable format; set to 8.0
UInt32 length Byte length of this subtable (including the header)
UInt32 language Language code for this encoding subtable, or zero if language-independent
UInt8 is32[65536] Tightly packed array of bits (8K bytes total) indicating whether the particular 16-bit (index) value is the start of a 32-bit character code


Method Summary
 int mapCharCode(int charCode)
          map char code.
 void writeXML(XMLStreamWriter writer)
          Write the data to a XMLStreamWriter.
 
Methods inherited from class org.extex.font.format.xtf.tables.TtfTableCMAP.Format
addAttributes, getFormat, getLength, getVersion, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

mapCharCode

public int mapCharCode(int charCode)
map char code.

Specified by:
mapCharCode in class TtfTableCMAP.Format
Parameters:
charCode - the charcode
Returns:
Returns the map char code
See Also:
TtfTableCMAP.Format.mapCharCode(int)

writeXML

public void writeXML(XMLStreamWriter writer)
              throws java.io.IOException
Write the data to a XMLStreamWriter.

Parameters:
writer - the XML-Writer
Throws:
java.io.IOException - if an IO-error occurs.
See Also:
XMLWriterConvertible.writeXML( org.extex.util.xml.XMLStreamWriter)