org.apache.fop.fonts.apps
Class PFMReader


public class PFMReader

A tool which reads PFM files from Adobe Type 1 fonts and creates XML font metrics file for use in FOP.

Author:
jeremias.maerki@outline.ch

Constructor Summary
PFMReader()
           

Method Summary
 org.w3c.dom.DocumentconstructFontXML(PFMFile pfm)
          Generates the font metrics file from the PFM file.
 PFMFileloadPFM(String filename)
          Read a PFM file and returns it as an object.
 static voidmain(String[] args)
          The main method for the PFM reader tool.
 org.w3c.dom.DocumentpostProcessXML(org.w3c.dom.Document doc)
          Modifies the generated font metrics file.
 voidpreview(PFMFile pfm)
          Displays a preview of the PFM file on the console.
 voidwriteFontXML(org.w3c.dom.Document doc, String target)
          Writes the generated DOM Document to a file.

Constructor Detail

PFMReader

public PFMReader()
Method Detail

constructFontXML

public org.w3c.dom.Document constructFontXML(PFMFile pfm)
Generates the font metrics file from the PFM file.
Parameters:
pfm - The PFM file to generate the font metrics from.
Returns: The DOM document representing the font metrics file.

loadPFM

public PFMFile loadPFM(String filename)
Read a PFM file and returns it as an object.
Parameters:
filename - The filename of the PFM file.
Returns: The PFM as an object.

main

public static void main(String[] args)
The main method for the PFM reader tool.
Parameters:
args - Command-line arguments: [pfm-file] {[xml-file]} If [xml-file] is not provided, then just a little preview of the PFM ist displayed.

postProcessXML

public org.w3c.dom.Document postProcessXML(org.w3c.dom.Document doc)
Modifies the generated font metrics file. First, it processes the character mmappings, then it sorts them.
Parameters:
doc - The DOM document representing the font metrics file.
Returns: A DOM document representing the processed font metrics file.

preview

public void preview(PFMFile pfm)
Displays a preview of the PFM file on the console.
Parameters:
pfm - The PFM file to preview.

writeFontXML

public void writeFontXML(org.w3c.dom.Document doc, String target)
Writes the generated DOM Document to a file.
Parameters:
doc - The DOM Document to save.
target - The target filename for the XML file.

Association Links

to Class java.lang.String

to Class java.lang.String