org.extex.font.format.tfm
Class TfmCharInfoWord

java.lang.Object
  extended by org.extex.font.format.tfm.TfmCharInfoWord
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
OfmCharInfoWord

public class TfmCharInfoWord
extends java.lang.Object
implements java.io.Serializable

Class for TFM char info word.

Each char_info_word contains six fields packed into four bytes as follows.

byte description
first width_index (8 bits)
second height_index (4 bits) times 16, plus depth_index (4 bits)
third italic_index (6 bits) times 4, plus tag (2 bits)
fourth remainder (8 bits)

The tag field has four values that explain how to interpret the remainder field.

tag description
0 no_tag: means that remainder is unused.
1 lig_tag: means that this character has a ligature/kerning program starting at lig_kern[remainder].
2 list_tag: means that this character is part of a chain of characters of ascending sizes, and not the largest in the chain. The remainder field gives the character code of the next larger character.
3 ext_tag: means that this character code represents an extensible character, i.e., a character that is built up of smaller pieces so that it can be made arbitrarily large. The pieces are specified in exten[remainder].

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

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

Field Summary
protected  int charid
          the char id.
static org.extex.font.format.tfm.TfmCharInfoWord.Tag EXT_TAG
          ext_tag: character is extensible.
static org.extex.font.format.tfm.TfmCharInfoWord.Tag LIG_TAG
          lig_tag: character has a ligature/kerning program.
static org.extex.font.format.tfm.TfmCharInfoWord.Tag LIST_TAG
          list_tag: character has a successor in a charlist.
static org.extex.font.format.tfm.TfmCharInfoWord.Tag NO_TAG
          no_tag: vanilla character.
static short NOCHARCODE
          Symbolic constant for nonexistent character code.
static int NOINDEX
          Symbolic constant for index which is not valid.
static int TAG0
          no_tag: 0.
static int TAG1
          no_tag: 1.
static int TAG2
          no_tag: 2.
static int TAG3
          no_tag: 3.
protected  int widthindex
          the width index.
 
Constructor Summary
protected TfmCharInfoWord()
          Creates a new object.
  TfmCharInfoWord(RandomAccessR rar, int id)
          Create a new object.
 
Method Summary
 void createLigKernMap()
          Create the ligature/kerning map.
 boolean exists()
          Test, if the character exists in the font.
 boolean foundEntry()
          Check, if char has a entry (glyph name, top, mid, bot, rep, ligature or kern.
 int getBc()
          Returns the bc.
 short getBot()
          Returns the bot.
 int getCharid()
          Returns the charid.
 TfmFixWord getDepth()
          Returns the depth.
 short getDepthindex()
          Returns the depth index.
 java.lang.String getGlyphname()
          Returns the glyph name.
 TfmFixWord getHeight()
          Returns the height.
 short getHeightindex()
          Returns the height index.
 TfmFixWord getItalic()
          Returns the italic.
 short getItalicindex()
          Returns the italic index.
 TfmFixWord getKerning(int cp2)
          Return the kerning.
 int getLigature(int cp2)
          Return the ligature.
 int getLigkernstart()
          Returns the ligkern start.
 TfmLigKern[] getLigKernTable()
          Getter for ligKernTable.
 short getMid()
          Returns the mid.
 short getNextchar()
          Returns the next char.
 short getRemainder()
          Returns the remainder.
 short getRep()
          Returns the rep.
 org.extex.font.format.tfm.TfmCharInfoWord.Tag getTag()
          Returns the tag.
 short getTagNumber()
          Returns the tag as number.
 short getTop()
          Returns the top.
 TfmFixWord getWidth()
          Returns the width.
 int getWidthindex()
          Returns the width index.
 void resetTag()
          Resets the tag field to NOTAG (zero) value.
 void setBc(int abc)
          Set bc.
 void setBot(short abot)
          Set the bot.
 void setDepth(TfmFixWord adepth)
          Det the depth.
 void setGlyphname(java.lang.String gn)
          Set the glyph name.
 void setHeight(TfmFixWord aheight)
          Set the height.
 void setItalic(TfmFixWord aitalic)
          Set the italic.
 void setLigkernstart(int ligkerns)
          Set the ligkern start.
 void setLigKernTable(TfmLigKern[] lk)
          Set the ligKernTable.
 void setMid(short amid)
          Set the mid.
 void setNextchar(short anextchar)
          Set the next char.
 void setRep(short arep)
          Set the rep.
 void setTop(short atop)
          Set the top.
 void setWidth(TfmFixWord awidth)
          Set the width.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXT_TAG

public static final org.extex.font.format.tfm.TfmCharInfoWord.Tag EXT_TAG
ext_tag: character is extensible.


LIG_TAG

public static final org.extex.font.format.tfm.TfmCharInfoWord.Tag LIG_TAG
lig_tag: character has a ligature/kerning program.


LIST_TAG

public static final org.extex.font.format.tfm.TfmCharInfoWord.Tag LIST_TAG
list_tag: character has a successor in a charlist.


NO_TAG

public static final org.extex.font.format.tfm.TfmCharInfoWord.Tag NO_TAG
no_tag: vanilla character.


NOCHARCODE

public static final short NOCHARCODE
Symbolic constant for nonexistent character code.

See Also:
Constant Field Values

NOINDEX

public static final int NOINDEX
Symbolic constant for index which is not valid.

See Also:
Constant Field Values

TAG0

public static final int TAG0
no_tag: 0.

See Also:
Constant Field Values

TAG1

public static final int TAG1
no_tag: 1.

See Also:
Constant Field Values

TAG2

public static final int TAG2
no_tag: 2.

See Also:
Constant Field Values

TAG3

public static final int TAG3
no_tag: 3.

See Also:
Constant Field Values

charid

protected int charid
the char id.


widthindex

protected int widthindex
the width index.

Constructor Detail

TfmCharInfoWord

protected TfmCharInfoWord()
Creates a new object. Only for subclasses.


TfmCharInfoWord

public TfmCharInfoWord(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

createLigKernMap

public void createLigKernMap()
Create the ligature/kerning map.


exists

public boolean exists()
Test, if the character exists in the font. (a character exists, if it have a width)

Returns:
Returns true if the character exists.

foundEntry

public boolean foundEntry()
Check, if char has a entry (glyph name, top, mid, bot, rep, ligature or kern.

Returns:
Returns true, if the char has an entry.

getBc

public int getBc()
Returns the bc.

Returns:
Returns the bc.

getBot

public short getBot()
Returns the bot.

Returns:
Returns the bot.

getCharid

public int getCharid()
Returns the charid.

Returns:
Returns the charid.

getDepth

public TfmFixWord getDepth()
Returns the depth.

Returns:
Returns the depth.

getDepthindex

public short getDepthindex()
Returns the depth index.

Returns:
Returns the depth index.

getGlyphname

public java.lang.String getGlyphname()
Returns the glyph name.

Returns:
Returns the glyph name.

getHeight

public TfmFixWord getHeight()
Returns the height.

Returns:
Returns the height.

getHeightindex

public short getHeightindex()
Returns the height index.

Returns:
Returns the height index.

getItalic

public TfmFixWord getItalic()
Returns the italic.

Returns:
Returns the italic.

getItalicindex

public short getItalicindex()
Returns the italic index.

Returns:
Returns the italic index.

getKerning

public TfmFixWord getKerning(int cp2)
Return the kerning.

Parameters:
cp2 - the right char. This character has to exist.
Returns:
the kerning.

getLigature

public int getLigature(int cp2)
Return the ligature. If no ligature exists, the -1 is returned.

Parameters:
cp2 - the right char. This character has to exist.
Returns:
the ligature.

getLigkernstart

public int getLigkernstart()
Returns the ligkern start.

Returns:
Returns the ligkern start.

getLigKernTable

public TfmLigKern[] getLigKernTable()
Getter for ligKernTable.

Returns:
Returns the ligKernTable.

getMid

public short getMid()
Returns the mid.

Returns:
Returns the mid.

getNextchar

public short getNextchar()
Returns the next char.

Returns:
Returns the next char.

getRemainder

public short getRemainder()
Returns the remainder.

Returns:
Returns the remainder.

getRep

public short getRep()
Returns the rep.

Returns:
Returns the rep.

getTag

public org.extex.font.format.tfm.TfmCharInfoWord.Tag getTag()
Returns the tag.

Returns:
Returns the tag.

getTagNumber

public short getTagNumber()
Returns the tag as number.

Returns:
Returns the tag as number.

getTop

public short getTop()
Returns the top.

Returns:
Returns the top.

getWidth

public TfmFixWord getWidth()
Returns the width.

Returns:
Returns the width.

getWidthindex

public int getWidthindex()
Returns the width index.

Returns:
Returns the width index.

resetTag

public void resetTag()
Resets the tag field to NOTAG (zero) value.


setBc

public void setBc(int abc)
Set bc.

Parameters:
abc - The bc to set.

setBot

public void setBot(short abot)
Set the bot.

Parameters:
abot - The bot to set.

setDepth

public void setDepth(TfmFixWord adepth)
Det the depth.

Parameters:
adepth - The depth to set.

setGlyphname

public void setGlyphname(java.lang.String gn)
Set the glyph name.

Parameters:
gn - The glyph name to set.

setHeight

public void setHeight(TfmFixWord aheight)
Set the height.

Parameters:
aheight - The height to set.

setItalic

public void setItalic(TfmFixWord aitalic)
Set the italic.

Parameters:
aitalic - The italic to set.

setLigkernstart

public void setLigkernstart(int ligkerns)
Set the ligkern start.

Parameters:
ligkerns - The ligkern start to set.

setLigKernTable

public void setLigKernTable(TfmLigKern[] lk)
Set the ligKernTable.

Parameters:
lk - The ligKernTable to set.

setMid

public void setMid(short amid)
Set the mid.

Parameters:
amid - The mid to set.

setNextchar

public void setNextchar(short anextchar)
Set the next char.

Parameters:
anextchar - The next char to set.

setRep

public void setRep(short arep)
Set the rep.

Parameters:
arep - The rep to set.

setTop

public void setTop(short atop)
Set the top.

Parameters:
atop - The top to set.

setWidth

public void setWidth(TfmFixWord awidth)
Set the width.

Parameters:
awidth - The width to set.