Skip to content

Latest commit

 

History

History
274 lines (178 loc) · 10 KB

XSL-DevNotes.md

File metadata and controls

274 lines (178 loc) · 10 KB

XSL Dev Notes

Apache FOP 2.1 | DocBook XSL 1.78.1

Some notes and useful links for working on FOP/XSL customization of the PDF template.


Table of Contents


Customization Topics

Fonts

Base-14 Fonts Set

The Adobe PostScript and PDF Specification specify a set of 14 fonts that must be available to every PostScript interpreter and PDF reader: Helvetica (normal, bold, italic, bold italic), Times (normal, bold, italic, bold italic), Courier (normal, bold, italic, bold italic), Symbol and ZapfDingbats.

The following font family names are hard-coded into FOP for the Base-14 font set:

Base-14 font font families
Helvetica Helvetica, sans-serif, SansSerif
Times Times, Times Roman, Times-Roman, serif, any
Courier Courier, monospace, Monospaced
Symbol Symbol
ZapfDingbats ZapfDingbats

Please note that recent versions of Adobe Acrobat Reader replace "Helvetica" with "Arial" and "Times" with "Times New Roman" internally. GhostScript replaces "Helvetica" with "Nimbus Sans L" and "Times" with "Nimbus Roman No9 L". Other document viewers may do similar font substitutions. If you need to make sure that there are no such substitutions, you need to specify an explicit font and embed it in the target document.

Custom Fonts

In earlier FOP versions, it was always necessary to create an XML font metrics file if you wanted to add a custom font. This inconvenient step has been removed and in addition to that, FOP supports auto-registration of fonts, i.e. FOP can find fonts installed in your operating system or can scan user-specified directories for fonts. Font registration via XML font metrics has been deprecated and is not recommended although it is still supported by the current code.

Font Ligatures

FOP 2.1 doesn't support font ligatures in PDF:

OpenType fonts support advanced layout features such as ligatures, small caps, swashes, alternates, old style figures and more. [...] These features are currently missing within FOP due to the implementation opting to favor a greater number of formats. [...] the current method extracts the Compact Font Format (CFF) data containing among other things the character definitions, optionally subsets and embeds the result as a Type1C font.

Lists

Ordered Lists

Bulleted Lists

Footnotes

Source Code Listings

Callouts

References:

Admonitions

Running Headers and Footers

Book Cover


Tech Specs

Asciidoctor-fopub uses the following components versions:

Software Project Version
Apache FOP 2.1
DocBook XSL 1.78.1
Apache Commons XML Resolver 1.2
Xalan 2.6.0
JEuclid 3.1.9
XSLTHL 2.1.0
Gradle 2.0

Useful Links

Reference Links

Asciidoctor Toolchain for PDF

Dependencies:

  • Apache™ FOP (Formatting Objects Processor)
  • XSLTHL (XSLT syntax highlighting) — at Sourceforge.
  • DocBook XSL
  • Apache Commons XML Resolver
  • Xalan
  • JEuclid
  • Gradle

DocBook

DocBook XSL Stylesheets

XSLTHL Syntax Highlighting

  • XSLTHL (XSLT syntax highlighting) — at Sourceforge.
  • XSLTHL Wiki — at Sourceforge.