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:
Define Your Own Font in FOP cfg.xml
How to provide my own font definitions for FOP to generate PDF files? I have my font definition created in an XML file.
✍: FYIcenter.com
If you have your font definition files generated as shown in the previous tutorial,
you can provide them to FOP command through a configuration XML file.
First, build the configuration XML file, cfg-font.xml, as shown below:
<?xml version="1.0"?>
<!-- cfg-font.xml
Copyright (c) 2018 FYIcenter.com
-->
<fop version="1.0">
<renderers>
<renderer mime="application/pdf">
<fonts>
<font metrics-url="\fyicenter\calibri.xml" kerning="no"
embed-url="\windows\fonts\calibri.ttf">
<font-triplet name="Calibri" style="normal" weight="normal"/>
</font>
<font metrics-url="\fyicenter\gothic.xml" kerning="no"
embed-url="\windows\fonts\gothic.ttf">
<font-triplet name="Gothic" style="normal" weight="normal"/>
</font>
</fonts>
</renderer>
</renderers>
</fop>
Generate the PDF output from missing-font.fo again with the above configuration file. You see no more missing font error:
\local\fop-2.2\fop>fop \fyicenter\missing-font.fo \temp\missing-font.pdf -c \fyicenter\cfg-font.xml org.apache.fop.events.LoggingEventListener processEvent INFO: Rendered page #1.
Open the PDF output file, missing-font.pdf in Acrobat Reader and
check the font properties, you will see your own fonts are embedded in the PDF:
This tutorial is valid in FOP 2.2, 2.1, and 2.0.
⇒ FOP Missing Italic and Bold Fonts for PDF
⇐ FOP TTFReader - Build Font Definitions
2018-04-12, ∼2966🔥, 0💬
Popular Posts:
JDK 1.1 source code directory contains Java source code for JDK 1.1 core classes: "C:\fyicenter\jdk-...
What Is js.jar in Rhino JavaScript 1.7R5? js.jar in Rhino JavaScript 1.7R5 is the JAR file for Rhino...
JDK 17 java.sql.rowset.jmod is the JMOD file for JDK 17 SQL Rowset module. JDK 17 SQL Rowset module ...
Where to get the Java source code for Connector/J 8.0 User Impl module? Java source code files for C...
JDK 11 jdk.rmic.jmod is the JMOD file for JDK 11 RMI (Remote Method Invocation) Compiler Tool tool, ...