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 Missing Font Error for PDF
Why I am getting the "Font Calibri,normal,400 not found. Substituting with any,normal,400" error with FOP?
✍: FYIcenter.com
FOP has built-in definitions only for generic fonts: serif, sans-serif, monospace,
and Base-14 fonts: Helvetica, Times, Courier, Symbol, ZapfDingbats.
If you are using a font that has not built-in definition,
you will get the "Font X not found. Substituting with any" error.
For example, "Calibri" is a popular font, but it has not built-in definition in FOP. So if you use font "Calibri" in your FO file as show below, FOP will give you an error:
<?xml version="1.0" encoding="utf-8"?>
<!-- missing-font.fo
Copyright (c) 2018 FYIcenter.com
-->
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="myPage">
<fo:region-body margin="1in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="myPage">
<fo:flow flow-name="xsl-region-body">
<fo:block>Default: Welcome to jar.FYIcenter.com!</fo:block>
<fo:block font-family="Calibri">Calibri: Welcome to jar.FYIcenter.com!</fo:block>
<fo:block font-family="Gothic">Gothic: Welcome to jar.FYIcenter.com!</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
Try to generate the PDF output from this FO file:
\local\fop-2.2\fop>fop \fyicenter\missing-font.fo \temp\missing-font.pdf org.apache.fop.events.LoggingEventListener processEvent WARNING: Font "Calibri,normal,400" not found. Substituting with "any,normal,400". org.apache.fop.events.LoggingEventListener processEvent WARNING: Font "Gothic,normal,400" not found. Substituting with "any,normal,400". org.apache.fop.events.LoggingEventListener processEvent INFO: Rendered page #1.
The 'WARNING: Font "Calibri,normal,400" not found. Substituting with "any,normal,400"' is actually an error. FOP will replace "Calibri" font with the placeholder "any" font.
Open the PDF output file, missing-font.pdf in Acrobat Reader and
check the font properties, you will see "any" font is mapped to "Time Roman":
This tutorial is valid in FOP 2.2, 2.1, and 2.0.
⇒ FOP TTFReader - Build Font Definitions
⇐ FOP Font Missing Glyph Error for PDF
2018-04-21, ∼4146🔥, 0💬
Popular Posts:
What JAR files are required to run dom\Counter.java provided in the Apache Xerces package? You can f...
JDK 17 jdk.jdeps.jmod is the JMOD file for JDK 17 JDeps tool, which can be invoked by the "jdeps" co...
JDK 7 tools.jar is the JAR file for JDK 7 tools. It contains Java classes to support different JDK t...
What Is in Xerces-J-bin.2.12.2.zip? Xerces-J-bin.2.12.2.zip file is the distribution package ZIP fil...
What Is poi-scratchpad-3.5.jar? poi-scratchpad-3.5.jar is one of the JAR files for Apache POI 3.5, w...