XMLMill - convert xml to pdf with java. Generate PDF from xml/xsl.

XMLMill User Guide

Version: 3.00 Date: January 2nd, 2008
This tutorial is opened in a separate window in order to maximize the legibility of this tutorial.
To return to XMLMill, close this browser window

This page as PDFPrinter friendly pageThis guide (!) as PDF

XMLMill Type1 Fonts

XMLMill supports external Type1 fonts, which can be embedded and/or subsetted in the generated PDF document.

This chapter explains the functionality XMLMill offers regarding standard Type1 fonts and external Type1 fonts. The configuration chapter explains the various configuration options regarding these functionalities.

Overview

Font handling is one of the most complex aspects when generating a PDF document. Due to the intelligent behavior of XMLMill the mapping between the initial encoding used in a xml/xsl document and the encoding used in a PDF document will be transparent for the user.

Encoding: Unicode

When a XML document is converted to a PDF document, the xml/xsl encoding is converted to UTF-16 (ISO-10646 codepage). In a next step these encodings will be mapped to the encoding defined in a font-metrics file. As a result the user does not need to know which glyph is represented by which character in the font-metrics file. Moreover, switching from one font to another should not be any problem (as long as the requested character is available in the font-file).

  • If a character does not exist in the font-file, a '?' (question mark) is shown. If the question mark is not defined in the font, the font's .notdef character will be displayed.

Font Embedding and Subsetting

Font Embedding

Standard fonts

PDF viewers support a core set of 14 standard fonts which are guaranteed to be available in all PDF viewer applications. These fonts include four faces of each of three Latin text typefaces (Courier, Helvetica and Times) and two symbolic fonts (Symbol and ITC ZapfDingbats).

These fonts have always been supported since version 1.0 of XMLMill. They are represented using a correct font-family, font-style and font-weight attribute (where applicable), as indicated in following table:

PostScript name font-family font-style font-weight
Courier Courier normal normal
Courier-Bold Courier normal bold
Courier-Oblique, Courier italic normal
Courier-BoldOblique, Courier italic bold
Helvetica Helvetica normal normal
Helvetica-Bold Helvetica normal bold
Helvetica-Oblique Helvetica italic normal
Helvetica-BoldOblique Helvetica italic bold
Times-Roman Times normal normal
Times-Bold Times normal bold
Times-Italic Times italic normal
Times-BoldItalic, Times italic bold
Symbol Symbol normal normal
ZapfDingbats Zapfdingbats normal normal

Example:

[001] 
[002] <ml:p font-family="Helvetica" font-style="normal" font-weight="bold"  
      font-size="8pt">
[004]   Some text
[005] <ml:/p>

As these fonts are guaranteed available by each viewer no font-metrics or font-program information is added to the PDF document. As a result, PDF documents generated with only standard fonts will have the smallest size possible.

External Type1 fonts

You can use external Type1 fonts to make-up PDF documents. XMLMill is capable of embedding font-metrics and font-programs into the generated PDF output.

To use an external Type1 font you need:

  • the corresponding font-metrics file (.afm file).
  • the corresponding font-program file (.pfb or .pfa file).
  • Type1 fonts can be configured by modifying the <external> element in the configuration file.
  • If an external Type1 font is not embedded, Acrobat will take it from the target system if available, or construct a substitute font according to the font descriptor in the PDF.
  • Support for the .pfm file-type will be added in a next version of XMLMill.

Font Subsetting

In order to decrease the size of the PDF output, XMLMill can embed only those characters from a font which are actually used in the document. This process is called font subsetting.

This is done by setting the subset attribute to on in the configuration file.

Font kerning

Font kerning is the process of determining the spacing adjustments between characters depending on context.

Font kerning is optional and may or may not be present for a given font. Kerning data is supplied in two forms: track-kerning and pair-wise-kerning. Track kerning is applied to all characters uniformly, whereas pair-wise kerning is applied to specific character pairs. Track kerning and pair-wise kerning can be used independently or together (that is, it is possible to apply track kerning to a line of text and then to apply pair-wise kerning).

  • XMLMill supports currently only pair-wise-kerning. Track-kerning will be added in a next version of XMLMill.

Ligatures

Ligatures are currently not supported.

Composite characters

Composite characters are currently not supported.

Copyright © 2001 - 2012. All rights reserved. XMLMill and XMLMill logo are trademarks of Pecunia Data Systems, bvba.
Powered by Apache CocoonPowered by XMLMill