## org.apache.fop.fonts.apps
Class TTFReader

    java.lang.Object
      |
      +--org.apache.fop.fonts.apps.TTFReader

public class TTFReader
extends java.lang.Object

A tool which reads TTF files and generates XML font metrics file for use in FOP.

Constructor Summary
`TTFReader()`

Method Summary
`org.w3c.dom.Document` `constructFontXML(TTFFile ttf, java.lang.String fontName, java.lang.String className, java.lang.String resource, java.lang.String file)` Generates the font metrics file from the PFM file.
`TTFFile` `loadTTF(java.lang.String filename)` Read a TTF file and returns it as an object.
`static void` `main(java.lang.String[] args)` The main method for the PFM reader tool.
`org.w3c.dom.Document` `postProcessXML(org.w3c.dom.Document doc)` Modifies the generated font metrics file.
`void` `preview(TTFFile ttf)` Displays a preview of the TTF file on the console.
`void` `writeFontXML(org.w3c.dom.Document doc, java.lang.String target)` Writes the generated DOM Document to a file.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TTFReader

    public TTFReader()

Method Detail

### main

    public static void main(java.lang.String[] args)

  The main method for the PFM reader tool.
  Parameters:
    `args` - Command-line arguments: [options] fontfile.ttf xmlfile.xml where options can be: -fn <fontname> default is to use the fontname in the .ttf file, but you can override that name to make sure that the embedded font is used instead of installed fonts when viewing documents with Acrobat Reader. -cn <classname> default is to use the fontname -ef <path to the truetype fontfile> will add the possibility to embed the font. When running fop, fop will look for this file to embed it -er <path to truetype fontfile relative to org/apache/fop/render/pdf/fonts> you can also include the fontfile in the fop.jar file when building fop. You can use both -ef and -er. The file specified in -ef will be searched first, then the -er file.

### loadTTF

    public TTFFile loadTTF(java.lang.String filename)

  Read a TTF file and returns it as an object.
  Parameters:
    `filename` - The filename of the PFM file.
  Returns:
    The PFM as an object.

### preview

    public void preview(TTFFile ttf)

  Displays a preview of the TTF file on the console.
  Parameters:
    `ttf` - The TTF file to preview.

### writeFontXML

    public void writeFontXML(org.w3c.dom.Document doc,
                             java.lang.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.

### constructFontXML

    public org.w3c.dom.Document constructFontXML(TTFFile ttf,
                                                 java.lang.String fontName,
                                                 java.lang.String className,
                                                 java.lang.String resource,
                                                 java.lang.String file)

  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.

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

Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.