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

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

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

Class for TFM char info word.

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

bytedescription
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.

tagdescription
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: 1.8 $
Author:
Michael Niedermair
See Also:
Serialized Form

Field Summary
static de.dante.extex.font.type.tfm.TFMCharInfoWord.Tag EXT_TAG
          ext_tag: character is extensible
static de.dante.extex.font.type.tfm.TFMCharInfoWord.Tag LIG_TAG
          lig_tag: character has a ligature/kerning program
static de.dante.extex.font.type.tfm.TFMCharInfoWord.Tag LIST_TAG
          list_tag: character has a successor in a charlist
static de.dante.extex.font.type.tfm.TFMCharInfoWord.Tag NO_TAG
          no_tag: vanilla character
static short NOCHARCODE
          Symbolic constant for nonexistent character code
static int
          Symbolic constant for index which is not valid
 
Constructor Summary
TFMCharInfoWord(RandomAccessR rar, int id)
          Create a new object
 
Method Summary
 void addGlyph(org.jdom.Element glyph)
          Add glyph to the element
 boolean exists()
          Test, if the character exists in the font.
 short getBc()
          Returns the bc.
 short getBot()
          Returns the bot.
 int getCharid()
          Returns the charid.
 TFMFixWord getDepth()
          Returns the depth.
 short getDepthindex()
          Returns the depthindex.
 java.lang.String getGlyphname()
          Returns the glyphname.
 TFMFixWord getHeight()
          Returns the height.
 short getHeightindex()
          Returns the heightindex.
 TFMFixWord getItalic()
          Returns the italic.
 short getItalicindex()
          Returns the italicindex.
 int getLigkernstart()
          Returns the ligkernstart.
 short getMid()
          Returns the mid.
 short getNextchar()
          Returns the nextchar.
 short getRemainder()
          Returns the remainder.
 short getRep()
          Returns the rep.
 de.dante.extex.font.type.tfm.TFMCharInfoWord.Tag getTag()
          Returns the tag.
 short getTagNumber()
          Returns the tag as number.
 short getTop()
          Returns the top.
 TFMFixWord getWidth()
          Returns the width.
 short getWidthindex()
          Returns the widthindex.
 void resetTag()
          Resets the tag field to NOTAG (zero) value.
 void setBc(short 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 glyphname.
 void setHeight(TFMFixWord aheight)
          Set the height.
 void setItalic(TFMFixWord aitalic)
          Set the italic
 void setLigkernstart(int ligkerns)
          Set the ligkernstart.
 void setLigKernTable(TFMLigKern[] lk)
          Set the ligKernTable
 void setMid(short amid)
          Set the mid.
 void setNextchar(short anextchar)
          Set the nextchar.
 void setRep(short arep)
          Set the rep.
 void setTop(short atop)
          Set the top.
 void setWidth(TFMFixWord awidth)
          Set the width
 void toPL(PlWriter out)
          Print all information (jn PL-format) to the writer.
 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

NO_TAG

public static final de.dante.extex.font.type.tfm.TFMCharInfoWord.Tag NO_TAG
no_tag: vanilla character


LIG_TAG

public static final de.dante.extex.font.type.tfm.TFMCharInfoWord.Tag LIG_TAG
lig_tag: character has a ligature/kerning program


LIST_TAG

public static final de.dante.extex.font.type.tfm.TFMCharInfoWord.Tag LIST_TAG
list_tag: character has a successor in a charlist


EXT_TAG

public static final de.dante.extex.font.type.tfm.TFMCharInfoWord.Tag EXT_TAG
ext_tag: character is extensible


NOCHARCODE

public static final short NOCHARCODE
Symbolic constant for nonexistent character code

See Also:
Constant Field Values

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

See Also:
Constant Field Values
Constructor Detail

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

getCharid

public int getCharid()
Returns the charid.

Returns:
Returns the charid.

getDepthindex

public short getDepthindex()
Returns the depthindex.

Returns:
Returns the depthindex.

getHeightindex

public short getHeightindex()
Returns the heightindex.

Returns:
Returns the heightindex.

getItalicindex

public short getItalicindex()
Returns the italicindex.

Returns:
Returns the italicindex.

getRemainder

public short getRemainder()
Returns the remainder.

Returns:
Returns the remainder.

getTagNumber

public short getTagNumber()
Returns the tag as number.

Returns:
Returns the tag as number.

getTag

public de.dante.extex.font.type.tfm.TFMCharInfoWord.Tag getTag()
Returns the tag.

Returns:
Returns the tag.

getWidthindex

public short getWidthindex()
Returns the widthindex.

Returns:
Returns the widthindex.

getLigkernstart

public int getLigkernstart()
Returns the ligkernstart.

Returns:
Returns the ligkernstart.

setLigkernstart

public void setLigkernstart(int ligkerns)
Set the ligkernstart.

Parameters:
ligkerns - The ligkernstart to set.

getBot

public short getBot()
Returns the bot.

Returns:
Returns the bot.

setBot

public void setBot(short abot)
Set the bot.

Parameters:
abot - The bot to set.

getDepth

public TFMFixWord getDepth()
Returns the depth.

Returns:
Returns the depth.

setDepth

public void setDepth(TFMFixWord adepth)
Det the depth.

Parameters:
adepth - The depth to set.

getHeight

public TFMFixWord getHeight()
Returns the height.

Returns:
Returns the height.

setHeight

public void setHeight(TFMFixWord aheight)
Set the height.

Parameters:
aheight - The height to set.

getItalic

public TFMFixWord getItalic()
Returns the italic.

Returns:
Returns the italic.

setItalic

public void setItalic(TFMFixWord aitalic)
Set the italic

Parameters:
aitalic - The italic to set.

getMid

public short getMid()
Returns the mid.

Returns:
Returns the mid.

setMid

public void setMid(short amid)
Set the mid.

Parameters:
amid - The mid to set.

getNextchar

public short getNextchar()
Returns the nextchar.

Returns:
Returns the nextchar.

setNextchar

public void setNextchar(short anextchar)
Set the nextchar.

Parameters:
anextchar - The nextchar to set.

getRep

public short getRep()
Returns the rep.

Returns:
Returns the rep.

setRep

public void setRep(short arep)
Set the rep.

Parameters:
arep - The rep to set.

getTop

public short getTop()
Returns the top.

Returns:
Returns the top.

setTop

public void setTop(short atop)
Set the top.

Parameters:
atop - The top to set.

getWidth

public TFMFixWord getWidth()
Returns the width.

Returns:
Returns the width.

setWidth

public void setWidth(TFMFixWord awidth)
Set the width

Parameters:
awidth - The width to set.

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.

resetTag

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


setLigKernTable

public void setLigKernTable(TFMLigKern[] lk)
Set the ligKernTable

Parameters:
lk - The ligKernTable to set.

getGlyphname

public java.lang.String getGlyphname()
Returns the glyphname.

Returns:
Returns the glyphname.

setGlyphname

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

Parameters:
gn - The glyphname to set.

setBc

public void setBc(short abc)
Set bc.

Parameters:
abc - The bc to set.

toPL

public void toPL(PlWriter out)
          throws java.io.IOException
Description copied from interface: PlFormat
Print all information (jn PL-format) to the writer.

Specified by:
toPL in interface PlFormat
Parameters:
out - the plwriter
Throws:
java.io.IOException - if an IO-error occurs.
See Also:
PlFormat.toPL(de.dante.extex.font.type.PlWriter)

addGlyph

public void addGlyph(org.jdom.Element glyph)
Add glyph to the element

Parameters:
glyph - the element

getBc

public short getBc()
Returns the bc.

Returns:
Returns the bc.

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)