org.extex.font.format.xtf.tables.cff
Class T2TDOEncoding

java.lang.Object
  extended by org.extex.font.format.xtf.tables.cff.T2CharString
      extended by org.extex.font.format.xtf.tables.cff.T2Operator
          extended by org.extex.font.format.xtf.tables.cff.T2TopDICTOperator
              extended by org.extex.font.format.xtf.tables.cff.T2TDONumber
                  extended by org.extex.font.format.xtf.tables.cff.T2TDOEncoding
All Implemented Interfaces:
XMLWriterConvertible

public class T2TDOEncoding
extends T2TDONumber

Encoding.

Note: The encoding table in a CFF font is indexed by glyph index; the first encoded glyph index is 1.

Encoding data is located via the offset operand to the Encoding operator in the Top DICT. Only one Encoding operator can be specified per font except for CIDFonts which specify no encoding. A glyph's encoding is specified by a 1-byte code that permits values in the range 0-255. Each encoding is described by a format-type identifier byte followed by format-specific data. Two formats are currently defined.

Version:
$Revision: 7274 $
Author:
Michael Niedermair

Field Summary
static int EXPERT_ENCODING
          ExpertEncoding
static int FONT_DEFINED
          FontDefined
static int STANDARD_ENCODING
          StandardEncoding
 
Fields inherited from class org.extex.font.format.xtf.tables.cff.T2TopDICTOperator
CFF_CHARSET, CFF_CHARSTRINGS, CFF_CHARSTRINGTYPE, CFF_CIDCOUNT, CFF_CIDFONTREVISION, CFF_CIDFONTTYPE, CFF_CIDFONTVERSION, CFF_COPYRIGHT, CFF_ENCODING, CFF_FAMILYNAME, CFF_FDARRAY, CFF_FDSELECT, CFF_FONTBBOX, CFF_FONTMATRIX, CFF_FONTNAME, CFF_FULLNAME, CFF_ISFIXEDPITCH, CFF_ITALICANGLE, CFF_NOTICE, CFF_PAINTTYPE, CFF_POSTSCRIPT, CFF_PRIVATE, CFF_ROS, CFF_STROKEWIDTH, CFF_SYNTHETICBASE, CFF_UIDBASE, CFF_UNDERLINEPOSITION, CFF_UNDERLINETHICKNESS, CFF_UNIQUEID, CFF_VERSION, CFF_WEIGHT, CFF_XUID, TYPE_CHARSET, TYPE_CHARSTRINGS, TYPE_CHARSTRINGTYPE, TYPE_CIDCOUNT, TYPE_CIDFONTREVISION, TYPE_CIDFONTTYPE, TYPE_CIDFONTVERSION, TYPE_COPYRIGHT, TYPE_ENCODING, TYPE_FAMILYNAME, TYPE_FDARRAY, TYPE_FDSELECT, TYPE_FONTBBOX, TYPE_FONTMATRIX, TYPE_FONTNAME, TYPE_FULLNAME, TYPE_ISFIXEDPITCH, TYPE_ITALICANGLE, TYPE_NOTDEF, TYPE_NOTICE, TYPE_PAINTTYPE, TYPE_POSTSCRIPT, TYPE_PRIVATE, TYPE_ROS, TYPE_STROKEWIDTH, TYPE_SYNTHETICBASE, TYPE_UIDBASE, TYPE_UNDERLINEPOSITION, TYPE_UNDERLINETHICKNESS, TYPE_UNIQUEID, TYPE_VERSION, TYPE_WEIGHT, TYPE_XUID
 
Fields inherited from class org.extex.font.format.xtf.tables.cff.T2CharString
ESCAPE, ESCAPE_BYTE, T2CALLGSUBR, T2CALLSUBR, T2CNTRMASK, T2ENDCHAR, T2FLEX, T2FLEX1, T2HFLEX, T2HFLEX1, T2HHCURVETO, T2HINTMASK, T2HLINETO, T2HMOVETO, T2HSTEM, T2HSTEMHM, T2HVCURVETO, T2RCURVELINE, T2RETURN, T2RLINECURVE, T2RLINETO, T2RMOVETO, T2RRCURVETO, T2VHCURVETO, T2VLINETO, T2VMOVETO, T2VSTEM, T2VSTEMHM, T2VVCURVETO, TYPE_CALLGSUBR, TYPE_CALLSUBR, TYPE_CNTRMASK, TYPE_ENDCHAR, TYPE_FLEX, TYPE_FLEX1, TYPE_HFLEX, TYPE_HFLEX1, TYPE_HHCURVETO, TYPE_HINTMASK, TYPE_HLINETO, TYPE_HMOVETO, TYPE_HSTEM, TYPE_HSTEMHM, TYPE_HVCURVETO, TYPE_RCURVELINE, TYPE_RETURN, TYPE_RLINECURVE, TYPE_RLINETO, TYPE_RMOVETO, TYPE_RRCURVETO, TYPE_VHCURVETO, TYPE_VLINETO, TYPE_VMOVETO, TYPE_VSTEM, TYPE_VSTEMHM, TYPE_VVCURVETO
 
Constructor Summary
T2TDOEncoding(java.util.List<T2CharString> stack)
          Create a new object.
T2TDOEncoding(OtfTableCFF cff, int numberOfGlyphs, T2TDOCharset charset)
          Creates a new object.
 
Method Summary
 java.lang.String getEncodingName()
          Getter for encodingName.
 java.lang.String getGlyphName(int pos)
          Returns the name of the glyph.
 int getID()
          Returns the id of the operator.
 java.lang.String getName()
          Return the name of the operator.
 void init(RandomAccessR rar, OtfTableCFF cff, int baseoffset, CffFont cffFont)
          Initialize.
 void writeXML(XMLStreamWriter writer)
          Write the data to a XMLStreamWriter.
 
Methods inherited from class org.extex.font.format.xtf.tables.cff.T2TDONumber
getBytes, getDouble, getInteger, getValue, isDouble, isInteger, toString
 
Methods inherited from class org.extex.font.format.xtf.tables.cff.T2TopDICTOperator
isTopDICTOperator, newInstance
 
Methods inherited from class org.extex.font.format.xtf.tables.cff.T2Operator
checkWidth, convertStackaddID, isOperator, newInstance, toText
 
Methods inherited from class org.extex.font.format.xtf.tables.cff.T2CharString
getInitPrio, isArray, isBoolean, isEscape, readNumber, readNumber, readSID, readTopDICTOperator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EXPERT_ENCODING

public static final int EXPERT_ENCODING
ExpertEncoding

See Also:
Constant Field Values

FONT_DEFINED

public static final int FONT_DEFINED
FontDefined

See Also:
Constant Field Values

STANDARD_ENCODING

public static final int STANDARD_ENCODING
StandardEncoding

See Also:
Constant Field Values
Constructor Detail

T2TDOEncoding

public T2TDOEncoding(java.util.List<T2CharString> stack)
              throws java.io.IOException
Create a new object.

Parameters:
stack - the stack
Throws:
java.io.IOException - if an IO-error occurs.

T2TDOEncoding

public T2TDOEncoding(OtfTableCFF cff,
                     int numberOfGlyphs,
                     T2TDOCharset charset)
Creates a new object.

It use the default cff encoding.

Parameters:
cff - The cff table.
numberOfGlyphs - The number of glyphs.
charset - The charset.
Method Detail

getEncodingName

public java.lang.String getEncodingName()
Getter for encodingName.

Returns:
the encodingName

getGlyphName

public java.lang.String getGlyphName(int pos)
Returns the name of the glyph.

Parameters:
pos - The position in the encoding.
Returns:
Returns the name of the glyph.

getID

public int getID()
Returns the id of the operator.

Specified by:
getID in class T2Operator
Returns:
Returns the id of the operator.
See Also:
T2Operator.getID()

getName

public java.lang.String getName()
Return the name of the operator.

Specified by:
getName in class T2Operator
Returns:
Return the name of the operator.
See Also:
T2Operator.getName()

init

public void init(RandomAccessR rar,
                 OtfTableCFF cff,
                 int baseoffset,
                 CffFont cffFont)
          throws java.io.IOException
Initialize.

Overrides:
init in class T2Operator
Parameters:
rar - The input
cff - The cff table
baseoffset - The base offset from cff.
cffFont - The cff font.
Throws:
java.io.IOException - if an IO-error occurred.
See Also:
T2Operator.init(org.extex.util.file.random.RandomAccessR, org.extex.font.format.xtf.tables.OtfTableCFF, int, org.extex.font.format.xtf.tables.cff.CffFont)

writeXML

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

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