Abstract
This document is a reference manual for XEP rendering engine. It contains a detailed description of supported input and output formats, layout control features, and formatter configuration. In the last chapter, issues specific to Java platform are discussed.
Table of Contents
RenderX XEP is a high-quality page layout engine. It takes XML data as input and produces layout descriptions in one of the industry-standard page description languages — PDF or PostScript. Input data are expressed in W3C-recommended languages, XSL Formatting Objects and SVG, plus a number of extensions to complement and extend them.
The following topics are covered in this Reference:
XEP configuration files and parameters;
supported input and output formats, including RenderX proprietary extensions to standard formats;
details of support for various graphic formats;
supported font types, and how to configure them for use with XEP;
language-related algorithms adopted by XEP.
The behaviour of XEP formatter is controlled by a single configuration file, that must always be made accessible to the formatter. It stores information about core formatter options, lists fonts available to the formatter, and describes language-specific data. Having a single file that completely defines XEP's behaviour permits easy switching between different XEP configurations, and facilitates environment tuneup.
Methods to locate the configuration file are different on different platforms; please refer to specific platform documentation for details. By default, the formatter looks for file named xep.xml in the current directory of the process where it runs.
The configuration file is an XML document in a special namespace: "http://www.renderx.com/XEP/config". Its formal grammar (DTD) is given in Appendix B. The root of configuration file should be a <config> element. It includes three major subsections:
options for XEP rendering core and backends are defined inside the <options> element;
fonts configuration is contained in <fonts>;
hyphenation and language-dependent parameters are configured in the <languages> section.
Through the rest of this chapter, we discuss the overall structure of each section in the configuration file. Specific instructions for setting up fonts and output generators are contained in the respective chapters of this Reference.
Some parameters can accept URLs as values. In these cases, the location of configuration file is used as a base to resolve relative URLs. The base URL can be overridden for any subtree of the configuration file, by the effect of xml:base attribute.
Usually, a monolithic configuration file is the most convenient way to store XEP configuration. However, you may need to move parts of configuration into separate files; for example, when font configuration needs to be reused across multiple setups. The configuration file supports modularization: any container element can be moved into a separate XML file whose location is specified by a href attribute.
|
Note: |
All relative URLs in parameter values stored in a referenced file are resolved with respect to that file, rather than the top-level configuration file. Attribute xml:base in the referrer file has no effect on URLs that are contained in another file. |
XEP core and backend options can also be specified in platform-dependent ways, overriding values set in the configuration file. Please refer to the documentation provided with your version of XEP for details.
The operation of XEP 4.2 is controlled by a number of options. An option has a name and an associated value: name=value. In the configuration file, an option is defined by an <option> element; its name attribute defines option's name, and the value sets its value. XEP core options are always specified as a direct children of the <options> element. The following core options are defined for XEP 4.2:
Location of the license file. XEP looks for a license file at startup, and refuses to run if the signature on the license does not match the public key associated with the specific edition of the formatter. This file is also used as an access key to XEP online update service. The parameter can be specified either as a file name in the local filesystem, or as an URL. In addition to common protocols, data: and resource: URL schemes are supported.
Default: license.xml
Boolean value (true/false). Controls validation of input. In non-validating mode, XEP runs faster and takes less memory; however, less errors are intercepted, and the results of formatting are less predictable for malformed input. We discourage setting this switch to false until your stylesheets are thoroughly debugged.
Default: true
Boolean value (true/false). Controls termination of processing upon unsuccessful validation.
Default: true
Validator strictness level. Valid values are 0 (relaxed), 1 (normal), and 2 (strict).
Default: 1 (normal strictness)
Path to the directory for temporary files. If set, this parameter must point to a writeable directory, specified either as a path in the local filesystem, or as a file URL. To disable writing temporary files to disk, specify none as the value for this option.
|
Note: |
To avoid file name clashes, a separate temporary directory should be specified for each process running XEP. |
Default: none
Icon inserted as a replacement for broken or missing images. The parameter can be specified either as a file name in the local filesystem, or as an URL. In addition to the common protocols, data: and resource: URL schemes are supported.
Default: images/404.gif
Boolean value. Controls placement of footnotes in multi-column layouts. When set to false, footnote areas are subtracted from individual columns where footnote anchor occurs, rather than spanning across the page.
Default: true
Sets default page width.
Default: 576pt (8 in)
Sets default page height.
Default: 792pt (11 in)
Boolean value (true/false). Controls whether the formatter uses or ignores glyph kerning data to determine character positions.
Default: true
Principal output formats for XEP are Adobe Portable Document Format (version 1.3 or higher), or PostScript (Level 2 or 3). Each format is produced by a special module, called output generator (sometimes referred to as backends). Apart from the two standard generators, there is also a special backend that prints out an XML document corresponding to the stream of drawing events issued by the formatter core. This intermediate XML format is typically used for postprocessing manipulation or debugging through XEP API; it is described in Appendix C.
Each generator has configuration parameters that you can modify to control different aspects of produced documents. PDF generator parameters control PDF security options, PDF stream compression, viewer preferences etc. PostScript generator parameters control PostScript language options and Distiller parameters (via pdfmark operators). The only parameter of the XML output generator controls representation of images in the resulting document. All these parameters are thoroughly discussed in the chapter Output Formats.
Default settings for output generators can also be specified inside <options> element in the configuration file. To distinguish them from core options, they are wrapped in <generator-options> element. Attribute format of this element defines target output format for the generator. For example, the following fragment turns on linearization for PDF generator and sets initial zoom factor to fit-width for both PostScript and PDF backends:
<generator-options format="PDF">
<option name="LINEARIZE" value="true"/>
<option name="INITIAL_ZOOM" value="fit-width"/>
</generator-options>
<generator-options format="PostScript">
<option name="INITIAL_ZOOM" value="fit-width"/>
</generator-options>
|
Configurable parameters for all generators are listed in Appendix A, and discussed in more details in chapter Output Formats.
Font configuration is specified inside <fonts> element. It contains descriptors for font families, font groups, and font aliases; the formatter uses them to map XSL-FO font properties to actual fonts.
A font family is a group of fonts that share a common design, but differ in stylistic attributes: upright or italic, light or bold, etc. A font family is the basic configuration unit in XEP: individual fonts are bundled into groups by the family they belong to. All data pertinent to one font family is contained in a <font-family> element. It bears a required name attribute that identifies the font family. Family names should be unique within the configuration file: they are matched against the respective XSL-FO property value. The default font family (the one used when no font family is specified in the input file, or no other family matches) is defined by the default-family attribute of the <fonts> element. Tts value is a family name that must be present in the file, otherwise a configuration error occurs.
A typical font family descriptor looks like this:
<font-family name="Courier">
<font>
<font-data afm="Courier.afm"/>
</font>
<font style="oblique">
<font-data afm="Courier-Oblique.afm"/>
</font>
<font weight="bold">
<font-data afm="Courier-Bold.afm"/>
</font>
<font weight="bold" style="oblique">
<font-data afm="Courier-BoldOblique.afm"/>
</font>
</font-family> |
Inside the family descriptor, there are one or more entries for individual fonts that belong to the family. A font entry is specified by a <font> element. It has attributes to specify features of the font within the family, such as weight, style, and variant. For a font to be selected by a formatter, these attributes should match font-weight, font-style, and font-variant specified in the XSL-FO document.
Actual characteristics of the font are specified by a mandatory <font-data> element, located inside the <font>. Its attributes specify locations of various auxiliary files used by the formatter to retrieve font metric data and outlines, and set additional parameters that may be needed to interpret font data properly. Different attributes are needed for different font types. Supported font types and their configuration requirements are discussed in more details in chapter Fonts.
Most fonts can be either embedded into the resulting PDF or PostScript document, or specified as external fonts; in the latter case, the resulting file will only be viewable on systems that have the correspondent font configured for use with viewing/printing application. Typically, all fonts are embedded except for 14 standard Adobe PDF fonts; for some applications, embedding basic fonts may also be required. Embedding of a font is controlled by embed attribute of the <font> element describing the font.
An embedded font can be subsetted: instead of storing the entire font in the document, it is possible to leave only those glyphs that are actually used in the text. This option reduces the document size but makes it unsuitable for subsequent editing. Subsetting is governed by subset attribute of the <font> element.
To provide a more compact notation, embed and subset properties are inheritable down the configuration tree: when specified on a node in the configuration file, they affect all <font> descendants of that node. For example, embed/subset attributes specified on <font-family> will affect all fonts in that family; placing them on <font-group> will set the respective parameters for all fonts in all families in the group (unless overridden on some descendant node), etc.
|
Note: |
TrueType and OpenType fonts may contain internal flags that prohibit their embedding or subsetting. XEP honors these flags, and may refuse to embed or subset your font if the respective action is not authorized by the flags inside it. |
In XEP 4.2, there is a possibility to apply algorithmic slanting to fonts, in order to produce oblique or backslanted versions of fonts that don't have separate outlines for these styles. This is done by placing a <transform> element inside the <font> descriptor. The slant angle is specified in the slant-angle attribute on the <transform> node. Its value sets the angle in degrees. Positive angles slant the text clockwise, producing oblique versions; negative ones rotate it counterclockwise, producing backslanted font styles.
If a font family contains no entry for oblique or italic font style, the oblique font is produced algorithmically by applying a default slanting of 12°. Similarly, a missing backslant font is synthesized from the nearest upright version, slanting it by -12°.
In XEP 4.2, fonts can be instructed to contract certain sequences of characters into ligatures. A set of ligature characters is specified in the ligatures attribute of the <font> element, as a space- or comma -separated list of ligature characters. The characters must be a Unicode ligature codepoints.
|
Note: |
In XEP 4.2, ligaturization support is basic: only ligatures registered in Unicode can be used. Moreover, ligaturization does not work for characters that undergo contextual shaping: this excludes all Arabic ligatures from consideration. Further versions of XEP are expected to improve ligaturization support. |
Several font families can be wrapped into a <font-group> container element. Groups can be nested, forming complex font hierarchies. This element does not affect font mapping, and serves only for logical grouping of font families. In particular, it is often convenient to use it as a host for xml:base property, to specify a common base directory for a group of font fanilies that form a package. Another suggested use of <font-group> is for remoting: contents of the font group can be placed into a separate file, and reused across multiple font configurations.
The only attribute specific to <font-group> is label: it assigns a name to the group. The name serves only for record keeping: no constraints are imposed on it.
XEP 4.2 uses font aliases to provide alternate names for font families, and group several families into one “logical” family. A font alias is defined by a <font-alias> element. The element has two attributes, both required: name is the name of the “logical” font family, and value is a comma-separated list of font family names to which it should resolve. The list may contain a single font family; in this case, the alias merely provides an alternate name for it.
|
Note: |
Aliases always resolve to “real” families, and not to other aliases. Chained alias resolution is not possible in XEP 4.2. |
Language-specific configuration parameters are stored in the third major section of the configuration file, inside a <languages> element. It contains one or more <language> elements; each <language> stores information pertaining to a single language. The language is identified by two attributes: name attribute provides a name of the language, and codes attribute contains a list of codes used to refer to the language in the XSL-FO input data. Codes in the list are separated by spaces.
In XEP 4.2 two kinds of data are configurable in this section of the configuration files: hyphenation patterns and language-specific font aliases.
XEP 4.2 uses TeX hyphenation patterns for hyphenation data. Details on hyphenation algorithm are given in a separate chapter, Hyphenation.
A hyphenationm pattern file is associated with a language by placing a <hyphenation> element into the language section in the configuration file. Its pattern attribute specifies the URL to the TeX pattern file. An optional encoding attribute specifies the encoding of the pattern file; if it is missing, UTF-8 is assumed.
Language sections may also contain <font-alias> elements, described above in chapter Font Aliases. These aliases are activated when the language is selected in the input XSL-FO document; they take precedence over aliases specified in the <fonts> section of the configuration file, and may mask them.
This section describes the implementation of XSL Formatting Objects in XEP — an XSL Engine for PDF developed by RenderX, Inc, version 4.2. It lists all supported formatting objects and their properties, provides information about fallbacks for unsupported objects, and discusses details of XSL spec interpretation adopted in the engine.
XEP 4.2 implements Extensible Stylesheet Language version 1.0 as specified in the "XSL 1.0 Recommendation of October 15, 2001" (http://www.w3.org/TR/2001/REC-xsl-20011015/).
Legend:
Element/property is supported.
Element/property is not supported yet.
Element/property is not applicable (e.g. aural properties).
| § | Object Name | Implemented |
|---|---|---|
| 6.4.2 | <fo:root> | Yes |
| 6.4.3 | <fo:declarations> | No |
| 6.4.4 | <fo:color-profile> | No |
| 6.4.5 | <fo:page-sequence> | Yes |
| 6.4.6 | <fo:layout-master-set> | Yes |
| 6.4.7 | <fo:page-sequence-master> | Yes |
| 6.4.8 | <fo:single-page-master-reference> | Yes |
| 6.4.9 | <fo:repeatable-page-master-reference> | Yes |
| 6.4.10 | <fo:repeatable-page-master-alternatives> | Yes |
| 6.4.11 | <fo:conditional-page-master-reference> | Yes |
| 6.4.12 | <fo:simple-page-master> | Yes |
| 6.4.13 | <fo:region-body> | Yes |
| 6.4.14 | <fo:region-before> | Yes |
| 6.4.15 | <fo:region-after> | Yes |
| 6.4.16 | <fo:region-start> | Yes |
| 6.4.17 | <fo:region-end> | Yes |
| 6.4.18 | <fo:flow> | Yes |
| 6.4.19 | <fo:static-content> | Yes |
| 6.4.20 | <fo:title> | No |
| 6.5.2 | <fo:block> | Yes |
| 6.5.3 | <fo:block-container> | Yes |
| 6.6.2 | <fo:bidi-override> | Yes |
| 6.6.3 | <fo:character> | Yes |
| 6.6.4 | <fo:initial-property-set> | Yes |
| 6.6.5 | <fo:external-graphic> | Yes |
| 6.6.6 | <fo:instream-foreign-object> | Yes[1] |
| 6.6.7 | <fo:inline> | Yes |
| 6.6.8 | <fo:inline-container> | No[2] |
| 6.6.9 | <fo:leader> | Yes[3] |
| 6.6.10 | <fo:page-number> | Yes |
| 6.6.11 | <fo:page-number-citation> | Yes |
| 6.7.2 | <fo:table-and-caption> | Yes |
| 6.7.3 | <fo:table> | Yes |
| 6.7.4 | <fo:table-column> | Yes |
| 6.7.5 | <fo:table-caption> | Yes |
| 6.7.6 | <fo:table-header> | Yes |
| 6.7.7 | <fo:table-footer> | Yes[4] |
| 6.7.8 | <fo:table-body> | Yes |
| 6.7.9 | <fo:table-row> | Yes |
| 6.7.10 | <fo:table-cell> | Yes |
| 6.8.2 | <fo:list-block> | Yes |
| 6.8.3 | <fo:list-item> | Yes |
| 6.8.4 | <fo:list-item-body> | Yes |
| 6.8.5 | <fo:list-item-label> | Yes |
| 6.9.2 | <fo:basic-link> | Yes |
| 6.9.3 | <fo:multi-switch> | - |
| 6.9.4 | <fo:multi-case> | - |
| 6.9.5 | <fo:multi-toggle> | - |
| 6.9.6 | <fo:multi-properties> | - |
| 6.9.7 | <fo:multi-property-set> | - |
| 6.10.2 | <fo:float> | Yes[5] |
| 6.10.3 | <fo:footnote> | Yes |
| 6.10.4 | <fo:footnote-body> | Yes |
| 6.11.2 | <fo:wrapper> | Yes |
| 6.11.3 | <fo:marker> | Yes[6] |
| 6.11.4 | <fo:retrieve-marker> | Yes |
|
[1] <fo:instream-foreign-object> can host SVG graphics. [2] All contents is placed inline. [3] In this version, only plain text can be put inside leaders with leader-pattern="use-content". [4] Repeatable table footers are not implemented: the footer is drawn once at the end of the table. [5] Top-floats (float="before") area is drawn on top of the following page. [6] In the current version, markers cannot be specified as children of <fo:wrapper>. |
||
| § | Property Name | Implemented |
|---|---|---|
| 7.4.1 | source-document | No |
| 7.4.2 | role | No |
| 7.5.1 | absolute-position | Yes[1] |
| 7.5.2 | top | Yes |
| 7.5.3 | right | Yes |
| 7.5.4 | bottom | Yes |
| 7.5.5 | left | Yes |
| 7.6.1 | azimuth | - |
| 7.6.2 | cue-after | - |
| 7.6.3 | cue-before | - |
| 7.6.4 | elevation | - |
| 7.6.5 | pause-after | - |
| 7.6.6 | pause-before | - |
| 7.6.7 | pitch | - |
| 7.6.8 | pitch-range | - |
| 7.6.9 | play-during | - |
| 7.6.10 | richness | - |
| 7.6.11 | speak | - |
| 7.6.12 | speak-header | - |
| 7.6.13 | speak-numeral | - |
| 7.6.14 | speak-punctuation | - |
| 7.6.15 | speech-rate | - |
| 7.6.16 | stress | - |
| 7.6.17 | voice-family | - |
| 7.6.18 | volume | - |
| 7.7.1 | background-attachment | Yes |
| 7.7.2 | background-color | Yes |
| 7.7.3 | background-image | Yes |
| 7.7.4 | background-repeat | Yes |
| 7.7.5 | background-position-horizontal | Yes[2] |
| 7.7.6 | background-position-vertical | Yes[2] |
| 7.7.7 | border-before-color | Yes |
| 7.7.8 | border-before-style | Yes |
| 7.7.9 | border-before-width | Yes |
| 7.7.10 | border-after-color | Yes |
| 7.7.11 | border-after-style | Yes |
| 7.7.12 | border-after-width | Yes |
| 7.7.13 | border-start-color | Yes |
| 7.7.14 | border-start-style | Yes |
| 7.7.15 | border-start-width | Yes |
| 7.7.16 | border-end-color | Yes |
| 7.7.17 | border-end-style | Yes |
| 7.7.18 | border-end-width | Yes |
| 7.7.19 | border-top-color | Yes |
| 7.7.20 | border-top-style | Yes |
| 7.7.21 | border-top-width | Yes |
| 7.7.22 | border-bottom-color | Yes |
| 7.7.23 | border-bottom-style | Yes |
| 7.7.24 | border-bottom-width | Yes |
| 7.7.25 | border-left-color | Yes |
| 7.7.26 | border-left-style | Yes |
| 7.7.27 | border-left-width | Yes |
| 7.7.28 | border-right-color | Yes |
| 7.7.29 | border-right-style | Yes |
| 7.7.30 | border-right-width | Yes |
| 7.7.31 | padding-before | Yes |
| 7.7.32 | padding-after | Yes |
| 7.7.33 | padding-start | Yes |
| 7.7.34 | padding-end | Yes |
| 7.7.35 | padding-top | Yes |
| 7.7.36 | padding-bottom | Yes |
| 7.7.37 | padding-left | Yes |
| 7.7.38 | padding-right | Yes |
| 7.8.2 | font-family | Yes |
| 7.8.3 | font-selection-strategy | Yes |
| 7.8.4 | font-size | Yes |
| 7.8.5 | font-stretch | Yes |
| 7.8.6 | font-size-adjust | Yes |
| 7.8.7 | font-style | Yes |
| 7.8.8 | font-variant | No |
| 7.8.9 | font-weight | Yes |
| 7.9.1 | country | No |
| 7.9.2 | language | Yes |
| 7.9.3 | script | No |
| 7.9.4 | hyphenate | Yes |
| 7.9.5 | hyphenation-character | Yes |
| 7.9.6 | hyphenation-push-character-count | Yes |
| 7.9.7 | hyphenation-remain-character-count | Yes |
| 7.10.1 | margin-top | Yes |
| 7.10.2 | margin-bottom | Yes |
| 7.10.3 | margin-left | Yes |
| 7.10.4 | margin-right | Yes |
| 7.10.5 | space-before | Yes |
| 7.10.6 | space-after | Yes[3] |
| 7.10.7 | start-indent | Yes |
| 7.10.8 | end-indent | Yes |
| 7.11.1 | space-end | Yes |
| 7.11.2 | space-start | Yes |
| 7.12.1 | relative-position | No |
| 7.13.1 | alignment-adjust | Yes |
| 7.13.2 | alignment-baseline | Yes |
| 7.13.3 | baseline-shift | Yes |
| 7.13.4 | display-align | Yes |
| 7.13.5 | dominant-baseline | Yes |
| 7.13.6 | relative-align | Yes[4] |
| 7.14.1 | block-progression-dimension | Yes |
| 7.14.2 | content-height | Yes |
| 7.14.3 | content-width | Yes |
| 7.14.4 | height | Yes |
| 7.14.5 | inline-progression-dimension | Yes |
| 7.14.6 | max-height | No[5] |
| 7.14.7 | max-width | No[6] |
| 7.14.8 | min-height | No[7] |
| 7.14.9 | min-width | No[8] |
| 7.14.10 | scaling | Yes |
| 7.14.11 | scaling-method | No |
| 7.14.12 | width | Yes |
| 7.15.1 | hyphenation-keep | No |
| 7.15.2 | hyphenation-ladder-count | No |
| 7.15.3 | last-line-end-indent | Yes |
| 7.15.4 | line-height | Yes |
| 7.15.5 | line-height-shift-adjustment | Yes |
| 7.15.6 | line-stacking-strategy | Yes |
| 7.15.7 | linefeed-treatment | Yes[9] |
| 7.15.8 | white-space-treatment | Yes |
| 7.15.9 | text-align | Yes[10] |
| 7.15.10 | text-align-last | Yes |
| 7.15.11 | text-indent | Yes |
| 7.15.12 | white-space-collapse | Yes[11] |
| 7.15.13 | wrap-option | Yes |
| 7.16.1 | character | Yes |
| 7.16.2 | letter-spacing | Yes |
| 7.16.3 | suppress-at-line-break | No |
| 7.16.4 | text-decoration | Yes |
| 7.16.5 | text-shadow | Yes[12] |
| 7.16.6 | text-transform | Yes[13] |
| 7.16.7 | treat-as-word-space | No |
| 7.16.8 | word-spacing | Yes |
| 7.17.1 | color | Yes |
| 7.17.2 | color-profile-name | No |
| 7.17.3 | rendering-intent | No |
| 7.18.1 | clear | Yes |
| 7.18.2 | float | Yes[14] |
| 7.18.3 | intrusion-displace | Yes[15] |
| 7.19.1 | break-after | Yes |
| 7.19.2 | break-before | Yes |
| 7.19.3 | keep-together | Yes[16] |
| 7.19.4 | keep-with-next | Yes[16] |
| 7.19.5 | keep-with-previous | Yes[16] |
| 7.19.6 | orphans | Yes |
| 7.19.7 | widows | Yes |
| 7.20.1 | clip | No |
| 7.20.2 | overflow | Yes[17] |
| 7.20.3 | reference-orientation | Yes |
| 7.20.4 | span | Yes |
| 7.21.1 | leader-alignment | No |
| 7.21.2 | leader-pattern | Yes |
| 7.21.3 | leader-pattern-width | Yes |
| 7.21.4 | leader-length | Yes |
| 7.21.5 | rule-style | Yes |
| 7.21.6 | rule-thickness | Yes |
| 7.22.1 | active-state | - |
| 7.22.2 | auto-restore | - |
| 7.22.3 | case-name | - |
| 7.22.4 | case-title | - |
| 7.22.5 | destination-placement-offset | No |
| 7.22.6 | external-destination | Yes[18] |
| 7.22.7 | indicate-destination | No |
| 7.22.8 | internal-destination | Yes |
| 7.22.9 | show-destination | Yes[19] |
| 7.22.10 | starting-state | - |
| 7.22.11 | switch-to | - |
| 7.22.12 | target-presentation-context | - |
| 7.22.13 | target-processing-context |