org.extex.font.format.xtf.tables
Class TtfTableGLYF.Descript

java.lang.Object
  extended by org.extex.font.format.xtf.tables.TtfTableGLYF.Descript
All Implemented Interfaces:
XMLWriterConvertible
Direct Known Subclasses:
TtfTableGLYF.CompositeDescript, TtfTableGLYF.SimpleDescript
Enclosing class:
TtfTableGLYF

public abstract static class TtfTableGLYF.Descript
extends java.lang.Object
implements XMLWriterConvertible

Simple Glyph Description.

Array of last points of each contour; n is the number of contours.
Type Name Description
USHORT endPtsOfContours[n]
USHORT instructionLength Total number of bytes for instructions.
BYTE instructions[n] Array of instructions for each glyph; n is the number of instructions.
BYTE flags[n] Array of flags for each coordinate in outline; n is the number of flags.
BYTE or SHORT xCoordinates[ ] First coordinates relative to (0,0); others are relative to previous point.
BYTE or SHORT yCoordinates[ ] First coordinates relative to (0,0); others are relative to previous point.

Each flag is a single byte. Their meanings are shown below.

/tr>
Flags Bit Description
On Curve 0 If set, the point is on the curve; otherwise, it is off the curve.
x-Short Vector 1 If set, the corresponding x-coordinate is 1 byte long, not 2.
y-Short Vector 2 If set, the corresponding y-coordinate is 1 byte long, not 2.
Repeat 3 If set, the next byte specifies the number of additional times this set of flags is to be repeated. In this way, the number of flags listed can be smaller than the number of points in a character.
This x is same (Positive x-Short Vector) 4 This flag has two meanings, depending on how the x-Short Vector flag is set. If x-Short Vector is set, this bit describes the sign of the value, with 1 equalling positive and 0 negative. If the x-Short Vector bit is not set and this bit is set, then the current x-coordinate is the same as the previous x-coordinate. If the x-Short Vector bit is not set and this bit is also not set, the current x-coordinate is a signed 16-bit delta vector.
This y is same (Positive y-Short Vector) 5 This flag has two meanings, depending on how the y-Short Vector flag is set. If y-Short Vector is set, this bit describes the sign of the value, with 1 equalling positive and 0 negative. If the y-Short Vector bit is not set and this bit is set, then the current y-coordinate is the same as the previous y-coordinate. If the y-Short Vector bit is not set and this bit is also not set, the current y-coordinate is a signed 16-bit delta vector.
Reserved 6 This bit is reserved. Set it to zero.
Reserved 7 This bit is reserved. Set it to zero.


Field Summary
static byte ONCURVE
          Flag: ONCURVE
protected  TtfTableGLYF parentTable
          parent table
static byte REPEAT
          Flag: REPEAT
static byte XDUAL
          Flag: XDUAL
static byte XSHORTVECTOR
          Flag: XSHORTVECTOR
static byte YDUAL
          Flag: YDUAL
static byte YSHORTVECTOR
          Flag: YSHORTVECTOR
 
Constructor Summary
protected TtfTableGLYF.Descript(TtfTableGLYF parentTable, short numberOfContours, java.io.ByteArrayInputStream bais)
          Create a new object.
 
Method Summary
 short[] getInstructions()
          Returns the instructions
 int getNumberOfContours()
          Returns the number of contours.
 short getXMax()
          Returns the x max.
 short getXMin()
          Returns the x min.
 short getYMax()
          Returns the y max.
 short getYMin()
          Returns the y min.
protected  void readInstructions(java.io.ByteArrayInputStream bais, int count)
          Read the instructions
protected  void readInstructions(RandomAccessR rar, int count)
          Read the instructions
 void writeXML(XMLStreamWriter writer)
          Write the data to a XMLStreamWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ONCURVE

public static final byte ONCURVE
Flag: ONCURVE

See Also:
Constant Field Values

REPEAT

public static final byte REPEAT
Flag: REPEAT

See Also:
Constant Field Values

XDUAL

public static final byte XDUAL
Flag: XDUAL

See Also:
Constant Field Values

XSHORTVECTOR

public static final byte XSHORTVECTOR
Flag: XSHORTVECTOR

See Also:
Constant Field Values

YDUAL

public static final byte YDUAL
Flag: YDUAL

See Also:
Constant Field Values

YSHORTVECTOR

public static final byte YSHORTVECTOR
Flag: YSHORTVECTOR

See Also:
Constant Field Values

parentTable

protected TtfTableGLYF parentTable
parent table

Constructor Detail

TtfTableGLYF.Descript

protected TtfTableGLYF.Descript(TtfTableGLYF parentTable,
                                short numberOfContours,
                                java.io.ByteArrayInputStream bais)
Create a new object.

Parameters:
parentTable - the parent table
numberOfContours - number of conttours
bais - the basis
Method Detail

getInstructions

public short[] getInstructions()
Returns the instructions

Returns:
Returns the instructions

getNumberOfContours

public int getNumberOfContours()
Returns the number of contours.

Returns:
Returns the number of contours.

getXMax

public short getXMax()
Returns the x max.

Returns:
Returns the x max.

getXMin

public short getXMin()
Returns the x min.

Returns:
Returns the x min

getYMax

public short getYMax()
Returns the y max.

Returns:
Returns the y max.

getYMin

public short getYMin()
Returns the y min.

Returns:
Returns the y min.

readInstructions

protected void readInstructions(java.io.ByteArrayInputStream bais,
                                int count)
Read the instructions

Parameters:
bais - input
count - count

readInstructions

protected void readInstructions(RandomAccessR rar,
                                int count)
                         throws java.io.IOException
Read the instructions

Parameters:
rar - input
count - count
Throws:
java.io.IOException - if an IO-error occurs

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)