de.dante.extex.font.type.vf.command
Class VFCommandFontDef

java.lang.Object
  extended byde.dante.extex.font.type.vf.command.VFCommand
      extended byde.dante.extex.font.type.vf.command.VFCommandFontDef
All Implemented Interfaces:
PlFormat, XMLWriterConvertible

public class VFCommandFontDef
extends VFCommand
implements PlFormat

VFCommand: fnt_def.

After the pre command, the preamble continues with font definitions; every font needed to specify 'actual' characters in later set_char commands is defined here. The font definitions are exactly the same in VF files as they are in DVI files, except that the scaled size s is relative and the design size d is absolute:

    fnt_def1   243  k[1]  c[4]  s[4]  d[4]  a[1]  l[1]  n[a+l]
 

Define font k, where 0 <= k < 256.

    fnt_def2   244  k[2]  c[4]  s[4]  d[4]  a[1]  l[1]  n[a+l]
 

Define font k, where 0 <= k < 65536.

    fnt_def3   245  k[3]  c[4]  s[4]  d[4]  a[1]  l[1]  n[a+l]
 

Define font k, where 0 <= k < 2^24

.
    fnt_def4   246  k[4]  c[4]  s[4]  d[4]  a[1]  l[1]  n[a+l]
 

Define font k, where -2^31 <= k <= 2^31.

These font numbers k are 'local'; they have no relation to font numbers defined in the DVI file that uses this virtual font. The dimension s, which represents the scaled size of the local font being defined, is a fix_word relative to the design size of the virtual font. Thus if the local font is to be used at the same size as the design size of the virtual font itself, s will be the integer value 2^20. The value of s must be positive and less than 2^24 (thus less than 16 when considered as a fix_word). The dimension d is a fix_word in units of printer's points; hence it is identical to the design size found in the corresponding TFM file.

The four-byte value c is the check sum. Parameter s contains a fixed-point scale factor that is applied to the character widths in font k; font dimensions in TFM files and other font files are relative to this quantity, which is always positive and less than 227. It is given in the same units as the other dimensions of the DVI file. Parameter d is similar to s; it is the design size, and (like s) it is given in DVI units. Thus, font k is to be used at mag s/1000d times its normal size. The remaining part of a font definition gives the external name of the font, which is an ASCII string of length a + l. The number a is the length of the area or directory, and l is the length of the font name itself; the standard local system font area is supposed to be used when a = 0. The n field contains the area in its first a bytes.

Version:
$Revision: 1.8 $
Author:
Michael Niedermair

Field Summary
 
Fields inherited from class de.dante.extex.font.type.vf.command.VFCommand
FNT_DEF_1, FNT_DEF_2, FNT_DEF_3, FNT_DEF_4, MAX_CHARACTER, MIN_CHARACTER, POST, PRE, SHIFT16, SHIFT8
 
Constructor Summary
VFCommandFontDef(RandomAccessR rar, int ccode, FontFactory fontfactory, java.util.Map fmap)
          Create e new object.
 
Method Summary
 int getChecksum()
          Returns the checksum.
 TFMFixWord getDesignsize()
          Returns the designsize.
 java.lang.String getFontname()
          Returns the fontname.
 int getFontnumbers()
          Returns the fontnumbers.
 TFMFixWord getScalefactor()
          Returns the scalefactor.
 TFMFont getTfmfont()
          Returns the tfmfont.
 VFFont getVffont()
          Returns the vffont.
 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 de.dante.extex.font.type.vf.command.VFCommand
getCommandCode, getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VFCommandFontDef

public VFCommandFontDef(RandomAccessR rar,
                        int ccode,
                        FontFactory fontfactory,
                        java.util.Map fmap)
                 throws java.io.IOException,
                        FontException
Create e new object.

Parameters:
rar - the input
ccode - the command code
fontfactory - the fontfactory
fmap - the fontmap
Throws:
java.io.IOException - if a IO-error occured
FontException - if a error reading the font.
Method Detail

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)

getChecksum

public int getChecksum()
Returns the checksum.

Returns:
Returns the checksum.

getDesignsize

public TFMFixWord getDesignsize()
Returns the designsize.

Returns:
Returns the designsize.

getFontname

public java.lang.String getFontname()
Returns the fontname.

Returns:
Returns the fontname.

getFontnumbers

public int getFontnumbers()
Returns the fontnumbers.

Returns:
Returns the fontnumbers.

getScalefactor

public TFMFixWord getScalefactor()
Returns the scalefactor.

Returns:
Returns the scalefactor.

getTfmfont

public TFMFont getTfmfont()
Returns the tfmfont.

Returns:
Returns the tfmfont.

getVffont

public VFFont getVffont()
Returns the vffont.

Returns:
Returns the vffont.

toPL

public void toPL(PlWriter out)
          throws java.io.IOException,
                 FontException
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.
FontException - if a font-error occurs.
See Also:
PlFormat.toPL( de.dante.extex.font.type.PlWriter)