public void initData(TrueTypeFont ttf,
TTFDataStream data) throws IOException {
numberOfContours = data.readSignedShort();
boundingBox.setLowerLeftX( data.readSignedShort() );
boundingBox.setLowerLeftY( data.readSignedShort() );
boundingBox.setUpperRightX( data.readSignedShort() );
boundingBox.setUpperRightY( data.readSignedShort() );
/**if( numberOfContours > 0 )
{
endPointsOfContours = new int[ numberOfContours ];
for( int i=0; i< numberOfContours; i++ )
{
endPointsOfContours[i] = data.readUnsignedShort();
}
int instructionLength = data.readUnsignedShort();
instructions = data.read( instructionLength );
//BJL It is possible to read some more information here but PDFBox
//does not need it at this time so just ignore it.
//not sure if the length of the flags is the number of contours??
//flags = new int[numberOfContours];
//first read the flags, and just so the TTF can save a couples bytes
//we need to check some bit masks to see if there are more bytes or not.
//int currentFlagIndex = 0;
//int currentFlag =
}*/
}
This will read the required data from the stream. |