*
* @throws IOException If there is an error reading from the stream.
*/
private KernPair parseKernPair() throws IOException
{
KernPair result = new KernPair();
String cmd = readString();
if( KERN_PAIR_KP.equals( cmd ) )
{
String first = readString();
String second = readString();
float x = readFloat();
float y = readFloat();
result.setFirstKernCharacter( first );
result.setSecondKernCharacter( second );
result.setX( x );
result.setY( y );
}
else if( KERN_PAIR_KPH.equals( cmd ) )
{
String first = hexToString( readString() );
String second = hexToString( readString() );
float x = readFloat();
float y = readFloat();
result.setFirstKernCharacter( first );
result.setSecondKernCharacter( second );
result.setX( x );
result.setY( y );
}
else if( KERN_PAIR_KPX.equals( cmd ) )
{
String first = readString();
String second = readString();
float x = readFloat();
result.setFirstKernCharacter( first );
result.setSecondKernCharacter( second );
result.setX( x );
result.setY( 0 );
}
else if( KERN_PAIR_KPY.equals( cmd ) )
{
String first = readString();
String second = readString();
float y = readFloat();
result.setFirstKernCharacter( first );
result.setSecondKernCharacter( second );
result.setX( 0 );
result.setY( y );
}
else
{
throw new IOException( "Error expected kern pair command actual='" + cmd + "'" );
}