org.apache.fop.fonts.apps

## Class AbstractFontReader

- java.lang.Object
- - org.apache.fop.fonts.apps.AbstractFontReader

- Direct Known Subclasses:
    PFMReader, TTFReader

      public abstract class AbstractFontReader
      extends Object

  Abstract base class for the PFM and TTF Reader command-line applications.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.apache.commons.logging.Log` | `log` Logger instance

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractFontReader()` Main constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static void` | `determineLogLevel(Map options)` Determines the log level based of the options from the command-line.
    `protected static String[]` | `parseArguments(Map options, String[] args)` Parse commandline arguments.
    `protected static void` | `setLogLevel(String level)` Sets the logging level.
    `void` | `writeFontXML(Document doc, File target)` Writes the generated DOM Document to a file.
    `void` | `writeFontXML(Document doc, 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`

- - ### Field Detail

    - #### log

          protected static final org.apache.commons.logging.Log log

      Logger instance

  - ### Constructor Detail

    - #### AbstractFontReader

          protected AbstractFontReader()

      Main constructor.

  - ### Method Detail

    - #### parseArguments

          protected static String[] parseArguments(Map options,
                                                   String[] args)

      Parse commandline arguments. put options in the HashMap and return arguments in the String array the arguments: -fn Perpetua,Bold -cn PerpetuaBold per.ttf Perpetua.xml returns a String[] with the per.ttf and Perpetua.xml. The hash will have the (key, value) pairs: (-fn, Perpetua) and (-cn, PerpetuaBold)
      Parameters:
        `options` - Map that will receive options
        `args` - the command-line arguments
      Returns:
        the arguments

    - #### setLogLevel

          protected static void setLogLevel(String level)

      Sets the logging level.
      Parameters:
        `level` - the logging level ("debug", "info", "error" etc., see Jakarta Commons Logging)

    - #### determineLogLevel

          protected static void determineLogLevel(Map options)

      Determines the log level based of the options from the command-line.
      Parameters:
        `options` - the command-line options

    - #### writeFontXML

          public void writeFontXML(Document doc,
                                   String target)
                            throws TransformerException

      Writes the generated DOM Document to a file.
      Parameters:
        `doc` - The DOM Document to save.
        `target` - The target filename for the XML file.
      Throws:
        `TransformerException` - if an error occurs during serialization

    - #### writeFontXML

          public void writeFontXML(Document doc,
                                   File target)
                            throws TransformerException

      Writes the generated DOM Document to a file.
      Parameters:
        `doc` - The DOM Document to save.
        `target` - The target file for the XML file.
      Throws:
        `TransformerException` - if an error occurs during serialization

Copyright © 2025 Apache Software Foundation. All rights reserved.