Generate K3.xml Metrics File in FOP


How to generate K3.xml Metrics File in FOP? The k3.xml provided in FOP is outdated.



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

\fyicenter>cd \local\fop-2.2\fop

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

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

\local\fop-2.2\fop>java -cp %FOP_PATH%\build\fop.jar;
   -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.2
... 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.

The same example is provided in FOP 2.2, 2.1, and 2.0. But you need to change dependent JAR file versions accordingly.


⇒ Run Example in FOP

⇐ Example Errors in FOP

⇑ FOP Commands and Examples

⇑⇑ FAQ for FOP (Formatting Object Processor)

2016-07-03, 3285👍, 0💬