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

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.T2TDOCharStrings
All Implemented Interfaces:
XMLWriterConvertible

public class T2TDOCharStrings
extends T2TDONumber

CharStrings.

CharStrings INDEX

This contains the charstrings of all the glyphs in a font stored in an INDEX structure. Charstring objects contained within this INDEX are accessed by GID. The first charstring (GID 0) must be the .notdef glyph. The number of glyphs available in a font may be determined from the count field in the INDEX. The format of the charstring data, and therefore the method of interpretation, is specified by the CharstringType operator in the Top DICT. The CharstringType operator has a default value of 2 indicating the Type 2 charstring format which was designed in conjunction with CFF. Type 1 charstrings are documented in the "Adobe Type 1 Font Format". Type 2 charstrings are described in Adobe Technical Note #5177: "Type 2 Charstring Format." Other charstring types may also be supported by this method.

Type 2

A Type 2 charstring program is a sequence of unsigned 8-bit bytes that encode numbers and operators. The byte value specifies a operator, a number, or subsequent bytes that are to be interpreted in a specific manner. The bytes are decoded into numbers and operators. One reason * the format is more economical than Type 1 is because the Type 2 charstring interpreter is required to count the number of arguments on the argument stack. It can thus detect additional sets of arguments for a single operator. The stack depth implementation limit is specified in Appendix B. A number, decoded from a charstring, is pushed onto the Type 2 argument stack. An operator expects its arguments in order from this argument stack with all arguments generally taken from the bottom of the stack (first argument bottom-most); however, some operators, particularly the subroutine operators, normally work from the top of the stack. If an operator returns results, they are pushed onto the Type 2 argument stack (last result topmost). In the following discussion, all numeric constants are decimal numbers, except where indicated.

Version:
$Revision: 6604 $
Author:
Michael Niedermair

Field Summary
 
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
T2TDOCharStrings(java.util.List<T2CharString> stack)
          Create a new object.
 
Method Summary
 CharString getCharString(int idx)
          Returns the charstring or null, if not found.
 CharString getCharString(java.lang.String name)
          Returns the charstring or null, if not found.
 int getID()
          Returns the id of the operator.
 int getInitPrio()
          Returns the priority for the init process.
 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
isArray, isBoolean, isEscape, readNumber, readNumber, readSID, readTopDICTOperator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

T2TDOCharStrings

public T2TDOCharStrings(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.
Method Detail

getCharString

public CharString getCharString(int idx)
Returns the charstring or null, if not found.

Parameters:
idx - the index.
Returns:
Returns the charstring.

getCharString

public CharString getCharString(java.lang.String name)
Returns the charstring or null, if not found.

Parameters:
name - The name of the charstring.
Returns:
Returns the charstring.

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

getInitPrio

public int getInitPrio()
Returns the priority for the init process.

Overrides:
getInitPrio in class T2CharString
Returns:
Returns the priority.
See Also:
T2CharString.getInitPrio()

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)