org.extex.font.format.vf
Class VfFont

java.lang.Object
  extended by org.extex.font.format.vf.VfFont
All Implemented Interfaces:
XMLWriterConvertible

public class VfFont
extends java.lang.Object
implements XMLWriterConvertible

This class read a VF-file.

A VF file is organized as a stream of 8-bit bytes, using conventions borrowed from DVI and PK files. Thus, a device driver that knows about DVI and PK format will already contain most of the mechanisms necessary to process VF files. We shall assume that DVI format is understood; the conventions in the DVI documentation (see, for example, TeX: The Program, part 31) are adopted here to define VF format.

Version:
$Revision: 7275 $
Author:
Michael Niedermair
See Also:
VF-Format

Field Summary
static int UNITS_PER_EM_DEFAULT
          units per em (default-value)
 
Constructor Summary
VfFont(java.lang.String fontname, java.io.InputStream in, TfmReader tfmreader)
          Creates a new object.
 
Method Summary
 VfCommandCharacterPackets getChar(int number)
          Returns the char command or null, if not found.
 java.util.List<VfCommand> getCmds()
          Getter for cmds.
 FixedDimen getDesignSize()
          Returns the design size.
 TfmFixWord getDesignSizeAsFixWord()
          Returns the design size as fix word.
 VfCommandFontDef getFont(int number)
          Returns the font command or null, if not found.
 java.lang.String getFontname()
          Getter for font name.
 java.util.Map<java.lang.Integer,VfCommandFontDef> getFonts()
          Getter for fonts.
 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

UNITS_PER_EM_DEFAULT

public static final int UNITS_PER_EM_DEFAULT
units per em (default-value)

See Also:
Constant Field Values
Constructor Detail

VfFont

public VfFont(java.lang.String fontname,
              java.io.InputStream in,
              TfmReader tfmreader)
       throws FontException
Creates a new object.

Parameters:
fontname - The font name.
in - The input.
tfmreader - The tfm reader for the font.
Throws:
FontException - if a font errror occurred.
Method Detail

getChar

public VfCommandCharacterPackets getChar(int number)
Returns the char command or null, if not found.

Parameters:
number - The number of the char.
Returns:
Returns the char command.

getCmds

public java.util.List<VfCommand> getCmds()
Getter for cmds.

Returns:
the cmds

getDesignSize

public FixedDimen getDesignSize()
Returns the design size.

Returns:
Returns the design size.
See Also:
TfmReader.getDesignSize()

getDesignSizeAsFixWord

public TfmFixWord getDesignSizeAsFixWord()
Returns the design size as fix word.

Returns:
Returns the design size as fix word.
See Also:
TfmReader.getDesignSizeAsFixWord()

getFont

public VfCommandFontDef getFont(int number)
Returns the font command or null, if not found.

Parameters:
number - The number of the font.
Returns:
Returns the font command.

getFontname

public java.lang.String getFontname()
Getter for font name.

Returns:
the font name

getFonts

public java.util.Map<java.lang.Integer,VfCommandFontDef> getFonts()
Getter for fonts.

Returns:
the fonts

writeXML

public void writeXML(XMLStreamWriter writer)
              throws java.io.IOException
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(org.extex.util.xml.XMLStreamWriter)