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:
What Are FOP Generic Font Families
What are generic font families used in FOP?
✍: FYIcenter.com
FOP supports 3 generic font families:
Here is how you can test this:
1. Create a FO file, generic-fonts.fo:
<?xml version="1.0" encoding="utf-8"?>
<!-- generic-fonts.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 font: Welcome to jar.FYIcenter.com!</fo:block>
<fo:block font-family="serif">serif: Welcome to jar.FYIcenter.com!</fo:block>
<fo:block font-family="sans-serif">sans-serif: Welcome to jar.FYIcenter.com!</fo:block>
<fo:block font-family="monospace">monospace: Welcome to jar.FYIcenter.com!</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
2. Generate the PDF output from this FO file.
\local\fop-2.2\fop>fop \fyicenter\generic-fonts.fo \temp\generic-fonts.pdf org.apache.fop.events.LoggingEventListener processEvent INFO: Rendered page #1.
3. View the output PDF file, generic-fonts.pdf, Adobe Acrobat Reader. Click "File > Properties" to open the properties screen. Then click the "Fonts" tab. You see the font information
Courier Type: Type 1 Encoding: Ansi Actual Font: CourierStd Actual Font Type: Type 1 Helvetica Type: Type 1 Encoding: Ansi Actual Font: ArialMT Actual Font Type: TrueType Times-Roman Type: Type 1 Encoding: Ansi Actual Font: TimesNewRomanPSMT Actual Font Type: TrueType
Note that how Acrobat Reader maps generic fonts to their own fonts:
serif > Times-Roman sans-serif > Helvetica monospace > Courier
The picture below shows you generic fonts used in the PDF file generated from FOP:
This tutorial is valid in FOP 2.2, 2.1, and 2.0.
⇐ The Default Font used by FOP
2018-04-21, ∼2124🔥, 0💬
Popular Posts:
Old version of xml-apis.jar. JAR File Size and Download Location: File name: xmlParserAPIs.jar File ...
What Is log4j-1.2.15.jar? I got the JAR file from apache-log4j-1.2.15.zip. log4j-1.2.15.jar is the v...
layout.jar is a component in iText Java library to provide layout functionalities. iText Java librar...
The Apache FontBox library is an open source Java tool to obtain low level information from font fil...
MP3SPI is a Java Service Provider Interface that adds MP3 (MPEG 1/2/2.5 Layer 1/2/3) audio format su...