FOP Base-14 Fonts for PDF

Q

What are Base-14 fonts supported in FOP for PDF?

✍: FYIcenter.com

A

FOP supports Base-14 fonts (required by all PDF viewers) for PDF output:

  • 4 fonts for Helvetica family: normal, bold, italic, bold italic.
  • 4 fonts for Times family: normal, bold, italic, bold italic.
  • 4 fonts for Courier family: normal, bold, italic, bold italic.
  • 1 font for Symbol family: normal, for Greek alphabets and some symbols like: Ω, φ, ≠.
  • 1 font for ZapfDingbats family: normal, for Zapf dingbats like: ✌, ✍, ❀.

Here is how you can test this:

1. Create a FO file, base-14-fonts.fo:

<?xml version="1.0" encoding="utf-8"?>
<!-- base-14-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 font-family="Helvetica">Helvetica: Welcome to jar.FYIcenter.com!</fo:block>
      <fo:block font-family="Times">Times: Welcome to jar.FYIcenter.com!</fo:block>
      <fo:block font-family="Courier">Courier: Welcome to jar.FYIcenter.com!</fo:block>
      <fo:block>Symbol: <fo:inline font-family="Symbol">Ω φ ≠</fo:inline></fo:block>
      <fo:block>ZapfDingbats: <fo:inline font-family="ZapfDingbats">✌ ✍ ❀</fo:inline></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\base-14-fonts.fo \temp\base-14-fonts.pdf
org.apache.fop.events.LoggingEventListener processEvent
INFO: Rendered page #1.

3. View the output PDF file, base-14-fonts.pdf, Adobe Acrobat Reader. Click "File > Properties" to open the properties screen. Then click the "Fonts" tab. You see the font information

Symbol
   Type: Type 1
   Encoding: Built-in
   Actual Font: Symbol
   Actual Font Type: Type 1

ZapfDingbats
   Type: Type 1
   Encoding: Built-in
   Actual Font: AdobePiStd
   Actual Font Type: Type 1

...

The picture below shows you Base-14 fonts used in the PDF file generated from FOP:
FOP Base-14 Fonts for PDF

This tutorial is valid in FOP 2.2, 2.1, and 2.0.

 

FOP Font Missing Glyph Error for PDF

What Are FOP Generic Font Families

Managing Fonts in FOP PDF Output

⇑⇑ FAQ for FOP (Formatting Object Processor)

2018-04-21, 194👍, 0💬