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

java.lang.Object
  extended by org.extex.font.format.xtf.tables.cff.T2CharString
      extended by org.extex.font.format.xtf.tables.cff.T2Number
Direct Known Subclasses:
T2Double, T2DummyNumber, T2Integer, T2Number16, T2NumberFraction, T2SID

public abstract class T2Number
extends T2CharString

Number.

Operand Encoding

251 - 254 (b0 251)*256 b1 108
Size b0 range Value range Value calculation
1 32 - 246 -107 - +107 b0 139
2 247 - 250 +108 - +1131 (b0 247)*256+b1+108
2 -1131 - -108
3 28 -32768 -+32767 b1<<8|b2
5 29 -(2^31) - +(2^31-1) b1<<24|b2<<16|b3<<8|b4
A real number operand is provided in addition to integer operands. This operand begins with a byte value of 30 followed by a variable-length sequence of bytes. Each byte is composed of two 4-bit nibbles. The first nibble of a pair is stored in the most significant 4 bits of a byte and the second nibble of a pair is stored in the least significant 4 bits of a byte.

Nibble Definitions

Nibble Represents
0 - 9 0 - 9
a . (decimal point)
b E
c -E
d reserved
e - (minus)
f end of number

Version:
$Revision: 6604 $
Author:
Michael Niedermair

Field Summary
 
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
protected T2Number()
          Create a new object.
 
Method Summary
abstract  double getDouble()
          Returns the value as double.
abstract  int getInteger()
          Returns the value as int.
 void init(RandomAccessR rar, OtfTableCFF cff, int baseoffset, CffFont cffFont)
          Initialize.
static T2Number newInstance(RandomAccessR rar)
          Create a new instance.
static T2Number newInstance(RandomAccessR rar, int b0)
          Create a new instance.
 
Methods inherited from class org.extex.font.format.xtf.tables.cff.T2CharString
getBytes, getInitPrio, isArray, isBoolean, isDouble, isEscape, isInteger, isOperator, isTopDICTOperator, readNumber, readNumber, readSID, readTopDICTOperator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

T2Number

protected T2Number()
Create a new object.

Method Detail

newInstance

public static T2Number newInstance(RandomAccessR rar)
                            throws java.io.IOException
Create a new instance.

Parameters:
rar - the input
Returns:
Returns the new T2Number object.
Throws:
java.io.IOException - if an IO-error occurs.

newInstance

public static T2Number newInstance(RandomAccessR rar,
                                   int b0)
                            throws java.io.IOException
Create a new instance.

Parameters:
rar - the input
b0 - the first byte
Returns:
Returns the new T2Number object.
Throws:
java.io.IOException - if an IO-error occurs.

getDouble

public abstract double getDouble()
Returns the value as double.

Returns:
Returns the value as double.

getInteger

public abstract int getInteger()
Returns the value as int.

Returns:
Returns the value as int.

init

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

Specified by:
init in class T2CharString
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:
T2CharString.init(org.extex.util.file.random.RandomAccessR, org.extex.font.format.xtf.tables.OtfTableCFF, int, org.extex.font.format.xtf.tables.cff.CffFont)