Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
FOP TTFReader - Build Font Definitions
How to build font definition file with FOP? I have the font file for my favorite font in TTF format.
✍: FYIcenter.com
If you the font file in TTF format,
you can build the font definition file with the FOP TTFReader program.
For example, you see "Calibri" and "Gothic" font files located in \windows\fonts folder:
813,876 calibri.ttf 137,568 gothic.ttf
You can run FOP TTFReader program to build the "Calibri" font definition file:
\local\fop-2.2\fop>java -cp %FOP_PATH%\build\fop.jar; %FOP_PATH%\lib\xercesImpl-2.9.1.jar; %FOP_PATH%\lib\xalan-2.7.2.jar; %FOP_PATH%\lib\avalon-framework-4.3.1.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.2.jar; %FOP_PATH%\lib\xmlgraphics-commons-2.2.jar org.apache.fop.fonts.apps.TTFReader -d \windows\calibri.ttf \fyicenter\calibri.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 C:\windows\fonts\calibri.ttf... org.apache.fop.fonts.apps.TTFReader loadTTF INFO: Font Family: [Calibri] 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 calibri.xml... org.apache.fop.fonts.apps.TTFReader main INFO: This font contains no embedding license restrictions. INFO: XML font metrics file successfully created.
Run FOP TTFReader program again to build the "Gothic" font definition file.
Open the \fyicenter\calibri.xml to see details of a font definition file:
<font-metrics metrics-version="2" type="TYPE0">
<font-name>Calibri</font-name>
<full-name>Calibri</full-name>
<family-name>Calibri</family-name>
<embed/>
<cap-height>634</cap-height>
<x-height>466</x-height>
<ascender>750</ascender>
<descender>-250</descender>
<bbox>
<left>-502</left>
<bottom>-307</bottom>
<right>1240</right>
<top>963</top>
</bbox>
<flags>33</flags>
<stemv>0</stemv>
<italicangle>0</italicangle>
<subtype>TYPE0</subtype>
<multibyte-extras>
This tutorial is valid in FOP 2.2, 2.1, and 2.0.
⇒ Define Your Own Font in FOP cfg.xml
⇐ FOP Missing Font Error for PDF
2018-04-12, ∼2268🔥, 0💬
Popular Posts:
Where to get the Java source code for Connector/J 8.0 Core Impl module? Java source code files for C...
What JAR files are required to run dom\Counter.java provided in the Apache Xerces package? You can f...
JDK 11 jdk.jlink.jmod is the JMOD file for JDK 11 JLink tool, which can be invoked by the "jlink" co...
JDK 11 jdk.internal.vm.ci.jmod is the JMOD file for JDK 11 Internal VM CI module. JDK 11 Internal VM...
What Is wstx-asl-3.2.8.jar? wstx-asl-3.2.8.jar is JAR file for the ASL component of Woodstox 3.2.8. ...