Generate K3.xml Metrics File in fop-2.0-bin.zip

Q

How to generate K3.xml Metrics File in fop-2.0-bin.zip? The k3.xml provided in fop-2.0-bin.zip is outdated.

✍: FYIcenter.com

A

K3.xml is the font metrics file for displaying barcode images. The K3.xml provided in fop-2.0-bin.zip is outdated. But we can regenerate it using the fop.jar:

\fyicenter>cd \local\fop-2.0

\local\fop-2.0>copy examples\fo\advanced\K3.xml 
   examples\fo\advanced\K3-original.xml

\local\fop-2.0>set FOP_PATH=\local\fop-2.0

\local\fop-2.0>java -cp %FOP_PATH%\build\fop.jar;
   %FOP_PATH%\lib\xercesImpl-2.7.1.jar;
   %FOP_PATH%\lib\xalan-2.7.0.jar;
   %FOP_PATH%\lib\avalon-framework-4.2.0.jar;
   %FOP_PATH%\lib\commons-logging-1.0.4.jar;
   %FOP_PATH%\lib\commons-io-1.3.1.jar;
   %FOP_PATH%\lib\serializer-2.7.0.jar;
   %FOP_PATH%\lib\xmlgraphics-commons-2.0.1.jar 
   org.apache.fop.fonts.apps.TTFReader 
   -d examples\fo\advanced\K3.ttf examples\fo\advanced\K3.xml

... org.apache.fop.fonts.apps.TTFReader main
INFO: TTF Reader for Apache FOP 2.0
... org.apache.fop.fonts.apps.TTFReader main
INFO: Parsing font...
... org.apache.fop.fonts.apps.TTFReader loadTTF
INFO: Reading examples\fo\advanced\K3.ttf...
... org.apache.fop.fonts.apps.TTFReader loadTTF
INFO: Font Family: [Keith Dimmock's 3 of 9 Barcode, New]
... org.apache.fop.fonts.apps.TTFReader constructFontXML
INFO: Creating xml font file...
... org.apache.fop.fonts.apps.TTFReader main
INFO: Creating CID encoded metrics...
... org.apache.fop.fonts.apps.AbstractFontReader writeFontXML
INFO: Writing xml font file examples\fo\advanced\K3.xml...
... org.apache.fop.fonts.apps.TTFReader main
INFO: This font contains no embedding license restrictions.
... org.apache.fop.fonts.apps.TTFReader main
INFO: XML font metrics file successfully created.

Back to FAQ on FOP (Formatting Objects Processor).

2016-07-03, 1016👍, 0💬