de.dante.extex.font.type.tfm
Class TFMLigKernCommand

java.lang.Object
  extended byde.dante.extex.font.type.tfm.TFMLigKernCommand
All Implemented Interfaces:
java.io.Serializable, XMLWriterConvertible

public class TFMLigKernCommand
extends java.lang.Object
implements XMLWriterConvertible, java.io.Serializable

Class for a lig_kern_command.

bytedescription
first skip_byte, indicates that this is the final program step if the byte is 128 or more, otherwise the next step is obtained by skipping this number of intervening steps.
second next_char: if next_char follows the current character, then perform the operation and stop, otherwise continue.
third op_byte, indicates a ligature step if less than 128, a kern step otherwise.
fourth remainder

Information from: The DVI Driver Standard, Level 0 The TUG DVI Driver Standards Committee

Version:
$Revision: 1.5 $
Author:
Michael Niedermair
See Also:
Serialized Form

Nested Class Summary
static class TFMLigKernCommand.Activity
          This is a type-safe class to represent activity information.
 
Field Summary
static TFMLigKernCommand.Activity ACCESSIBLE
          The value of activity field which means that this lig/kern instruction is a part of lig/kern program for some character.
static TFMLigKernCommand.Activity PASSTHROUGH
          The value of activity field which means that this is restart instruction or the boundary information which was processed.
static TFMLigKernCommand.Activity UNREACHABLE
          The value of activity field which means that this lig/kern instruction is not a part of lig/kern program for any character.
 
Constructor Summary
TFMLigKernCommand(RandomAccessR rar, int id)
          Create a new object
 
Method Summary
 TFMLigKernCommand.Activity getActivity()
           
 int getLkid()
          Returns the lkid.
 short getNextchar()
          Returns the nextchar.
 short getOpbyte()
          Returns the opbyte.
 short getRemainder()
          Returns the remainder.
 short getSkipbyte()
          Returns the skipbyte.
 int kernIndex()
          Gives the index to the kern table from tfm file for kerning instruction.
 boolean leaveLeft()
          Tells whether the current character should be left in place when executing this ligature instructions.
 boolean leaveRight()
          Tells whether the next character should be left in place when executing this ligature instructions.
 short ligChar()
          Gives the code of charcter which should be inserted between the current and the next characters when executing this ligature instruction.
 void makeStop()
          Forces this LigKern to be the last instruction in a lig/kern program.
 boolean meansBoundary()
          Tells whether this LigKern contains information about boundary.
 boolean meansKern()
          Tells whether this LigKern is a kerning instruction.
 boolean meansRestart()
          Tells whether this LigKern redirects the actual start of a lig/kern program to some other instruction (it must be also the first instruction of some lig/kern program).
 boolean meansStop()
          Tells whether this LigKern is the last instruction of a lig/kern program.
 short nextChar()
          Gives the code of the character which must be next to the current character if this instruction has to be activated.
 int nextIndex(int pos)
          Tells the position of the next lig/kern program instruction given the position of this LigKern in the lig/kern table.
 short opbyte()
          Gives the unsigned value of the opbyte.
 short remainder()
          Gives the unsigned value of uninterpreted remainder.
 int restartIndex()
          Gives actual starting index of the lig/kern program for restart instruction.
 void setActivity(TFMLigKernCommand.Activity act)
          Set the new value for actifity
 void setLigChar(short c)
          Forces the ligChar to have particular value.
 void setNextChar(int c)
          Forces this LigKern to have particular value of nextchar.
 short skipbyte()
          Gives the unsigned value of the skipbyte.
 byte stepOver()
          Tells how many character should be skipped over after executing this ligature instruction.
 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

UNREACHABLE

public static final TFMLigKernCommand.Activity UNREACHABLE
The value of activity field which means that this lig/kern instruction is not a part of lig/kern program for any character.


PASSTHROUGH

public static final TFMLigKernCommand.Activity PASSTHROUGH
The value of activity field which means that this is restart instruction or the boundary information which was processed.


ACCESSIBLE

public static final TFMLigKernCommand.Activity ACCESSIBLE
The value of activity field which means that this lig/kern instruction is a part of lig/kern program for some character.

Constructor Detail

TFMLigKernCommand

public TFMLigKernCommand(RandomAccessR rar,
                         int id)
                  throws java.io.IOException
Create a new object

Parameters:
rar - the input
id - the id
Throws:
java.io.IOException - if an IO-error occurs.
Method Detail

skipbyte

public short skipbyte()
Gives the unsigned value of the skipbyte.

Returns:
Return the amount of skip or the stop or boundary flag.

opbyte

public short opbyte()
Gives the unsigned value of the opbyte.

Returns:
Return the encoded ligature or kern operation.

remainder

public short remainder()
Gives the unsigned value of uninterpreted remainder.

Returns:
Return the remainder which meaning depends on the value of opbyte.

meansBoundary

public boolean meansBoundary()
Tells whether this LigKern contains information about boundary. (it must be also first or last in the lig/kern table).

Returns:
Return true if it contains boundary information.

meansRestart

public boolean meansRestart()
Tells whether this LigKern redirects the actual start of a lig/kern program to some other instruction (it must be also the first instruction of some lig/kern program).

Returns:
Return true if it is a restart instruction.

meansStop

public boolean meansStop()
Tells whether this LigKern is the last instruction of a lig/kern program.

Returns:
Return true if this is the last instruction of a lig/kern program.

nextIndex

public int nextIndex(int pos)
Tells the position of the next lig/kern program instruction given the position of this LigKern in the lig/kern table.

Parameters:
pos - the pos
Returns:
Returns index to the ligAuxTab of the next lig/kern instruction.

makeStop

public void makeStop()
Forces this LigKern to be the last instruction in a lig/kern program.


nextChar

public short nextChar()
Gives the code of the character which must be next to the current character if this instruction has to be activated.

Returns:
Returns the next character code.

setNextChar

public void setNextChar(int c)
Forces this LigKern to have particular value of nextchar.

Parameters:
c - the forced value of >nextchar.

restartIndex

public int restartIndex()
Gives actual starting index of the lig/kern program for restart instruction.

Returns:
Returns the actual start of lig/kern program.

meansKern

public boolean meansKern()
Tells whether this LigKern is a kerning instruction.

Returns:
Returns true for kerning instruction.

kernIndex

public int kernIndex()
Gives the index to the kern table from tfm file for kerning instruction.

Returns:
Returns the index to the kernTable.

leaveLeft

public boolean leaveLeft()
Tells whether the current character should be left in place when executing this ligature instructions.

Returns:
Returns true if the current character should be left.

leaveRight

public boolean leaveRight()
Tells whether the next character should be left in place when executing this ligature instructions.

Returns:
Returns true if the next character should be left.

stepOver

public byte stepOver()
Tells how many character should be skipped over after executing this ligature instruction.

Returns:
the number of characters to be skipped.

ligChar

public short ligChar()
Gives the code of charcter which should be inserted between the current and the next characters when executing this ligature instruction.

Returns:
Returns the code of the character to be inserted.

setLigChar

public void setLigChar(short c)
Forces the ligChar to have particular value.

Parameters:
c - the forced value of ligChar.

getActivity

public TFMLigKernCommand.Activity getActivity()
Returns:
Returns the activity.

setActivity

public void setActivity(TFMLigKernCommand.Activity act)
Set the new value for actifity

Parameters:
act - The activity to set.

getNextchar

public short getNextchar()
Returns the nextchar.

Returns:
Returns the nextchar.

getOpbyte

public short getOpbyte()
Returns the opbyte.

Returns:
Returns the opbyte.

getRemainder

public short getRemainder()
Returns the remainder.

Returns:
Returns the remainder.

getSkipbyte

public short getSkipbyte()
Returns the skipbyte.

Returns:
Returns the skipbyte.

getLkid

public int getLkid()
Returns the lkid.

Returns:
Returns the lkid.

writeXML

public void writeXML(XMLStreamWriter writer)
              throws java.io.IOException
Description copied from interface: XMLWriterConvertible
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(de.dante.util.xml.XMLStreamWriter)