public class TTFReader extends AbstractFontReader
| Modifier and Type | Field and Description |
|---|---|
static int |
METRICS_VERSION
Current version number for the metrics file
|
static java.lang.String |
METRICS_VERSION_ATTR
Used to detect incompatible versions of the generated XML files
|
log| Constructor and Description |
|---|
TTFReader()
Main constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
checkMetricsVersion(org.xml.sax.Attributes attr)
Bugzilla 40739, check that attr has a metrics-version attribute
compatible with ours.
|
org.w3c.dom.Document |
constructFontXML(TTFFile ttf,
java.lang.String fontName,
java.lang.String className,
java.lang.String resource,
java.lang.String file,
boolean isCid,
java.lang.String ttcName)
Generates the font metrics file from the TTF/TTC file.
|
TTFFile |
loadTTF(java.lang.String fileName,
java.lang.String fontName,
boolean useKerning,
boolean useAdvanced)
Read a TTF file and returns it as an object.
|
static void |
main(java.lang.String[] args)
The main method for the TTFReader tool.
|
determineLogLevel, parseArguments, setLogLevel, writeFontXML, writeFontXMLpublic static final java.lang.String METRICS_VERSION_ATTR
public static final int METRICS_VERSION
public static void main(java.lang.String[] args)
args - Command-line arguments: [options] fontfile.ttf xmlfile.xml
where options can be:
-fn public TTFFile loadTTF(java.lang.String fileName, java.lang.String fontName, boolean useKerning, boolean useAdvanced) throws java.io.IOException
fileName - The filename of the TTF file.fontName - The name of the fontuseKerning - true if should load kerning datauseAdvanced - true if should load advanced typographic table datajava.io.IOException - In case of an I/O problempublic org.w3c.dom.Document constructFontXML(TTFFile ttf, java.lang.String fontName, java.lang.String className, java.lang.String resource, java.lang.String file, boolean isCid, java.lang.String ttcName)
ttf - The PFM file to generate the font metrics from.fontName - Name of the fontclassName - Class name for the fontresource - path to the font as embedded resourcefile - path to the font as fileisCid - True if the font is CID encodedttcName - Name of the TrueType Collectionpublic static void checkMetricsVersion(org.xml.sax.Attributes attr)
throws org.xml.sax.SAXException
attr - attributes read from the root element of a metrics XML fileorg.xml.sax.SAXException - if incompatibleCopyright 1999-2012 The Apache Software Foundation. All Rights Reserved.