Unicorn Formatting Objects (UFO), Version 1.00.01 Support for XSL Formatting Objects and Properties TeX Back-End Created: 04-Sep-2000 Revised: 15-Sep-2000 Last revision: 29-Sep-2000 Copyright (C) 2000, Unicorn Enterprises SA All rights reserved 1 Introduction -------------- This document defines the subset of XSL formatting objects and their properties as supported by UFO version 1.00.01 using the TeX back-end. The detailed description of the TeX back-end interfaces and implementation is available as a separate document included in the product distribution: Unicorn Formatting Objects (UFO), Version 1.00.01 Specification for TeX Back-End Starting with version 1.00.01, UFO supports also HTML back-end. This back-end is not discussed here. The detailed description of HTML back-end features is available as a separate document included in the product distribution: Unicorn Formatting Objects (UFO), Version 1.00.01 Support for Formatting Objects and Properties HTML Back-End 2 General Notes --------------- Notational Conventions ---------------------- Known unsupported yet important features are marked with the ISSUE prefix in this document. In most cases, the decent effort will be made to implement them in the near future. ISSUE: Create a summary of all current ISSUEs at the end of this document. Front-end and Back-end ---------------------- The XSL processing part consists of the front-end (written in C++) and the back-end (written in TeX macro language with the substantial use of LaTeX packages). The front-end generates the sequence of TeX macro calls from the source XML file; the back end drives the TeX formatting engine interpreting macros generated by the front-end. Version of XSL Specification ---------------------------- The current release is based on the W3C specification "Extensible Stylesheet Language (XSL) Version 1.0" W3C Working Draft 27 March 2025 (http://www.w3c.org/TR/2000/WD-xsl-20000327) No claims are made about the conformance. Use of CSS2 Specification ------------------------- XSL specification does not define many important features. Instead, explicit (and in some cases implicit) references are made to CSS2 specification. Implementation of such features is based on the W3C specification "Cascading Stylesheets, Level 2 (CSS2)" W3C Recommendation 12 May 2024 (http://www.w3c.org/TR/1998/REC-CSS2-19980512) Formatting Objects, Properties and Property Values -------------------------------------------------- The following formatting objects are currently supported: fo:root fo:declarations fo:page-sequence fo:layout-master-set fo:page-sequence-master fo:single-page-master-reference fo:repeatable-page-master-reference fo:simple-page-master fo:region-body fo:region-before fo:region-after fo:flow fo:static-content fo:block fo:character fo:external-graphic fo:inline fo:leader fo:page-number fo:table-and-caption fo:table fo:table-column fo:table-caption fo:table-header fo:table-footer fo:table-body fo:table-row fo:table-cell fo:list-block fo:list-item fo:list-item-body fo:list-item-label fo:wrapper For all other formatting objects, UFO implements the appropriate fallbacks according to provisions of XSL WD (Chapter 8, "Conformance"). Detailed discussion of support for all formatting objects can be found in the following sections of this document. For each object type the list of supported properties is given as well. For unsupported formatting objects, the fallback implementation is described. Units of Measure ---------------- All units of measure defined by XSL except 'px' (pixels) are supported. In the internal calculations as well as in the output TeX code, for all properties except 'font-size', units of measure are converted to millimeters. For the 'font-size' property, units of measure are converted to points. Color Values ------------ Hexadecimal color values having the format #[a-fA-F0-9] are supported. Maximum of 6 hexadecimal digits allowed. These values represent RGB colors in the way similar to one described in HTML 4.0 specification. The following named color values are supported: aqua #00FFFF black #000000 blue #0000FF fuchsia #FF00FF gray #808080 green #008000 [sic!] lime #00FF00 maroon #800000 navy #000080 olive #808000 purple #800080 red #FF0000 silver #C0C0C0 teal #008080 white #FFFF00 An additional color value orange #FF8000 is supported for interoperability with the PassiveTex package. Percentages ----------- Percentages in property values are supported when applicable. Shorthand Properties -------------------- The following shorthand properties are supported border-width border-color border-style border-top border-right border-bottom border-left border font margin padding white-space The 'vertical-align' is implemented as a normal (not a shorthand) property and is currently supported for 'fo:external-graphic' only. Expressions ----------- XSL expressions are not implemented. The only exception is the minus sign that can precede numeric values. Inheritance ----------- Property inheritance is supported. A property that is implemented in this release may be assigned to a formatting object of any type allowed by XSL/CSS2, even if this formatting object makes no direct use of this property. The property value may be inherited and used by some child formatting object. In this document, properties of this kind are mentioned explicitly only for the formatting object types that make the direct use of them; however, for inheritance purposes these properties are supported also for other object types when allowed by XSL/CSS2. Writing Modes ------------- The 'writing-mode' property is not supported. By default, the 'lr-tb' writing mode is assumed. The relative margin, border and padding properties that contain 'before', 'after', 'start' and 'end' in their names are interpreted according to this writing mode. Margin Properties ----------------- The following margin properties are supported: margin-top margin-bottom margin-left margin-right margin-before margin-after margin-start margin-end space-before space-before.optimum space-after space-after.optimum In the sections that describe properties supported for each formatting object type, these properties are referenced collectively as "Margin Properties". Properties 'space-before' and 'space-before.optimum' are interpreted as corresponding to 'margin-top'; properties 'space-after' and 'space-after.optimum' are interpreted as corresponding to 'margin-bottom'. Margin collapsing/space resolution is not supported. ISSUE: Margin collapsing/space resolution is an important feature. It should be implemented in the near future. Border Properties ----------------- The following border properties are supported: border-top-style border-bottom-style border-left-style border-right-style border-before-style border-after-style border-start-style border-end-style border-top-color border-bottom-color border-left-color border-right-color border-before-color border-after-color border-start-color border-end-color border-top-width border-bottom-width border-left-width border-right-width border-before-width border-after-width border-start-width border-end-width All XSL border styles are accepted, but all styles other than 'none' and 'hidden' are interpreted as 'solid'. In the sections that describe properties supported for each formatting object type, these properties are referenced collectively as "Border Properties". Padding Properties ------------------ The following padding properties are supported: padding-top padding-bottom padding-left padding-right padding-before padding-after padding-start padding-end In the sections that describe properties supported for each formatting object type, these properties are referenced collectively as "Padding Properties". Font Properties --------------- The following font properties are supported: font-family font-style font-variant font-weight font-size In the sections that describe properties supported for each formatting object type, these properties are referenced collectively as "Font Properties". Currently only 35 standard PostScript fonts are supported. (This is lie. Few additional PostScript fonts available in NFSS packages provided with MiKTeX 1.20d are supported as well.) ISSUE: It is important to support installable PostScript fonts. This should be implemented in the near future. The font selection scheme described in CSS2 is supported. However, due to the limited number of PostScript fonts currently supported not all combinations of font properties are allowed. The following generic font families are supported serif Times sans-serif Helvetica cursive ZapfChancery monospace Courier The 'fantasy' generic font family is not supported since there is no true fantasy font among 35 standard PostScript fonts. Text Align ---------- The 'text-align' property is supported in block, external graphic and table cell formatting objects. The following property values are supported: 'left', 'right', 'center' and 'justify'. Properties Related to White Spaces ---------------------------------- The following properties related to white spaces are supported: linefeed-treatment space-treatment white-space-collapse wrap-option The property 'wrap-option' is supported in a special way. If this property has the value of 'no-wrap', it is interpreted as if 'linefeed-treatment' would be set to 'preserve' (the actual value of 'linefeed-treatment' is ignored in this case). Breaking Formatting Objects at Page Boundaries ---------------------------------------------- If a formatting object is mapped to a TeX box or if a formatting object is contained in a formatting object that is mapped to a TeX box, such formatting object cannot be split at the page boundary. The following formatting objects are mapped to TeX boxes: The 'fo:block', the 'fo:table-and-caption' or the 'fo:table-caption' object that either: - has 'height' property other than 'auto' - has 'background-color' property other than 'transparent' - has left and/or right border specified The 'fo:table' object that either: - is contained in another 'fo:table' object - is contained a in formatting object that is mapped to a TeX box The 'fo:cell' object. The 'break-before' and 'break-after' properties are not interpreted for formatting objects that are contained in formatting objects that cannot be broken at page boundaries. Advanced Typesetting Features ----------------------------- Some advanced features important for typesetting applications are not yet supported. This include (at least) multi-column output, footnotes, subscript/superscript, keeps, orphans and widows. ISSUE: These features should be implemented in the near future. Language-dependent Features --------------------------- Features, dependent on the language (hyphenation, etc.) are not supported. ISSUE: Due to the importance of these features, the Babel package should be employed in the future release of the TeX back-end. The corresponding XSL properties ('language', etc.) should be implemented. 3. Declaration and Pagination and Layout Formatting Objects ----------------------------------------------------------- Introduction ------------ Only A4 output media format is currently supported. ISSUE: Other common media formats are important as well. Media formats supported by LaTeX, PDFTEX and the most popular DVI drivers should be implemented in the near future. Sequence page masters are implemented. Each page master may indirectly reference several instances of 'fo:region-body', several instances of 'fo:region-before' and several instances of 'fo:region-after' formatting objects. However, currently the following limitations are imposed: - if several instances of 'fo:region-body' are referenced by some page master, all of them must have the same calculated values of 'margin-top', 'margin-bottom', 'margin-left' and 'margin-right' properties - if several instances of 'fo:region-before' are referenced by some page master, all of them must have the same calculated values of 'extent' property - if several instances of 'fo:region-after' are referenced by some page master, all of them must have the same calculated values of 'extent' property Several page sequences may be contained in a source document. Individual page sequences may use page masters that define different dimensions of page regions (i.e., that define different calculated values for 'margin-top', ..., 'extent' for page regions). However, the current implementation of the TeX back-end may produce wrong results (bad footer position) at the first page of the page sequence that generates changes in the region dimensions. (But several page sequences that reference the same page master or page masters that describe the same region dimensions, will be rendered correctly). fo:root ------- No individual properties supported. fo:declarations --------------- No individual properties supported. fo:color-profile ---------------- This formatting object class is handled with the fallback. fo:page-sequence ---------------- The following properties are supported: master-name initial-page-number Numeric values as well as 'auto', 'auto-odd' and 'auto-even' values are supported for 'initial-page-number' property. fo:layout-master-set -------------------- No individual properties supported. fo:page-sequence-master ----------------------- The following properties are supported: master-name fo:single-page-master-reference ------------------------------- The following properties are supported: master-name fo:repeatable-page-master-reference ----------------------------------- The following properties are supported: master-name maximum-repeats fo:repeatable-page-master-alternatives -------------------------------------- This formatting object class is handled with the fallback. The page-master referenced in the first 'fo:conditional-page-master-reference' child is used. The following properties are supported: maximum-repeats fo:conditional-page-master-reference ------------------------------------ This formatting object class is handled with the fallback. The page-master referenced in the first 'fo:conditional-page-master-reference' child is used. The following properties are supported: master-name fo:simple-page-master --------------------- The following properties are supported: master-name page-height page-width Margin Properties In the current release properties 'page-height' and 'page-width' are allowed to have the 'auto' value only. The page format is always A4. fo:region-body -------------- The following properties are supported: region-name Margin Properties fo:region-before ---------------- The following properties are supported: region-name extent fo:region-after --------------- The following properties are supported: region-name extent fo:region-start --------------- This formatting object class is handled with the fallback. The content of the corresponding 'fo:static-content' object is ignored. This fallback implementation is different from that recommended by XSL WD. The following properties are supported: region-name extent fo:region-end ------------- This formatting object class is handled with the fallback. The content of the corresponding 'fo:static-content' object is ignored. This fallback implementation is different from that recommended by XSL WD. The following properties are supported: region-name extent fo:flow ------- No individual properties supported. The 'flow-name' property, if specified, will be ignored by the front-end. fo:static-content ----------------- The following properties are supported: flow-name fo:title -------- This formatting object is ignored, together with its content. 4. Block-level Formatting objects --------------------------------- Introduction ------------ Algorithms described in CSS2 are used to calculate vertical and horizontal parameters of block objects (height, width, margins, border-widths, paddings); the support for 'auto' property values is provided when appropriate. fo:block -------- The following properties are supported: height width min-height min-width max-height max-width background-color Margin Properties Border Properties Padding Properties Font Properties color linefeed-treatment space-treatment text-align text-indent white-space-collapse wrap-option break-before break-after ISSUE: The 'line-height ' property is not yet supported. Due to the importance of this property, it should be implemented in the near future. fo:block-container ------------------ This formatting object class is handled with the fallback. The processor displays indication that content cannot be correctly rendered. 5. Inline-level Formatting Objects ---------------------------------- fo:bidi-override ---------------- This formatting object class is handled with the fallback. The processor displays indication that content cannot be correctly rendered. fo:character ------------ The following properties are supported: character Font Properties color fo:initial-property-set ----------------------- This formatting object class is handled with the fallback. Any properties specified on this object are ignored. fo:external-graphic ------------------- The following properties are supported: height width content-height content-width text-align vertical-align src Percentage values in 'content-height' and 'content-width' properties are supported. However, if one of this properties has the percentage value, the other property must be assigned either percentage or 'auto'. Percentage and length values of 'vertical-align' property are not supported. All string values specified by XSL WD are recognized but interpreted as follows: baseline interpreted as bottom middle middle sub bottom super top text-top top text-bottom bottom top top bottom bottom The 'src' property value is interpreted as a local file system file path specification rather than URI. ISSUE: It must be URI (to do in the near future). The set of supported graphical formats depends on the DVI driver used to render a document. Please, consult the local driver documentation. (And, if the particular DVI documentation appears to be ambiguous or incomplete, look directly into "*.DEF" files distributed with LaTeX2e graphics bundle). It is known that (at least in the MiKTeX 1.20d distribution) DVIPS supports (among others) EPS (Encapsulated PostScript) and BMP formats, and PDFTEX supports (among others) PDF, JPG and PNG formats. fo:instream-foreign-object -------------------------- This formatting object class is handled with the fallback. The processor displays indication that content cannot be correctly rendered. fo:inline --------- The following properties are supported: Font Properties color fo:inline-container ------------------- This formatting object class is handled with the fallback. The processor displays indication that content cannot be correctly rendered. fo:leader --------- The following properties are supported: leader-pattern rule-style rule-thickness The value 'use-content' of the 'leader-pattern' property is not supported and is interpreted as 'space'. Values 'double', 'groove' and 'ridge' of the 'rule-style' property are interpreted as 'solid'. fo:page-number -------------- The following properties are supported: Font Properties color Only Arabic representation of page numbers is supported. fo:page-number-citation ----------------------- This formatting object class is handled with the fallback. The processor displays indication that content cannot be correctly rendered. 6. Table Formatting Objects --------------------------- Introduction ------------ Support for tables with borders and padding is implemented. Certain limitations are imposed on the table layout by the current front-end implementation. Table columns must have the fixed width explicitly specified. For each table column the corresponding 'fo:table-column' object must be specified with the explicit length value of the 'column-width' property. Each 'fo:table-cell' formatting object must be contained in the 'fo:table-row' object. Explicit height and width for the entire table are not supported; for each 'fo:table' object the 'width' property must be 'auto' and the 'height' property is ignored by the front-end. Heights and widths specified individually for table cells are not supported. Collapsing borders are supported. Separated borders are NOT supported. The border collapsing algorithm is based on CSS2 guidelines. However, CSS2 provides no specification for several important aspects of border collapsing. For instance, it is not specified how to collapse adjacent borders of two cells that are different only in color. There is also no detailed specification about rendering of adjacent cell corners. The front-end tries to make consistent interpretation in the situations not specified by CSS2, but the output may look terrible in the certain (fortunately, quite exotic) cases. There is no collapsing implemented for the adjacent borders between header and body, body and body, body and footer. ISSUE: Do we need implementation for the separated border model? fo:table-and-caption -------------------- The following properties are supported: background-color Margin Properties Border Properties Padding Properties The 'caption-side' property is not supported. The table caption, if specified, is always rendered before the table. fo:table -------- The following properties are supported: width background-color Margin Properties Font Properties color break-before break-after The only supported value of the 'width' property is 'auto'. The 'height' property, if specified, is ignored by the front-end. fo:table-column --------------- The following properties are supported: column-width background-color Border Properties For each column of the table the corresponding 'fo:table-column' object is required. The 'column-width' property is mandatory and must specify the explicit length. fo:table-caption ---------------- The following properties are supported: height min-height min-width background-color Border Properties Padding Properties In the current implementation, the table caption is always rendered before the table. fo:table-header --------------- The following properties are supported: background-color Border Properties fo:table-footer --------------- The following properties are supported: background-color Border Properties fo:table-body ------------- The following properties are supported: background-color Border Properties fo:table-row ------------ The following properties are supported: height background-color Border Properties If the 'height' property contains the explicit length, it is used to specify the exact row height. If this property has the value of 'auto', the row height will be calculated by the back-end automatically. fo:table-cell ------------- The following properties are supported: background-color Border Properties Padding Properties Font Properties color linefeed-treatment space-treatment text-align text-indent white-space-collapse wrap-option Each 'fo:table-cell' object must be a child the 'fo:table-row' object. The 'height' and 'width' properties, if specified, are ignored by the front-end. Cells spanning several columns and/or rows are not yet implemented. ISSUE: Cells spanning several COLUMNS may be implemented in the near future. Implementing cells spanning several ROWS may be tricky and probably should be delayed for a distant future. By the way, existing specifications provide no reasonable definition for spanning cells. For instance, what about the border collapsing for the adjacent spanning cells in general case? 7. List Formatting Objects -------------------------- The complete set of list formatting objects is supported. In the current release, the horizontal layout of a list is fully controlled by the 'margin-left', 'margin-right', 'provisional-label-separation' and 'provisional-distance-between-starts' properties as follows: The distance between the left edge of the containing block and the left edge of the label if equal to 'margin-left'. The label width if equal to 'provisional-distance-between-starts' minus 'provisional-label-separation'. The distance between the right edge of the label and the left edge of the body is equal to 'provisional-label-separation'. The block width is equal to the width of the containing block minus 'margin-left' minus 'provisional-distance-between-starts' minus 'margin-right'. The distance between the right edge of the body and the right edge of the containing block is equal to 'margin-right'. fo:list-block ------------- The following properties are supported: Margin Properties provisional-label-separation provisional-distance-between-starts break-before break-after ISSUE: The support for 'background-color', Border Properties and Padding Properties should be implemented at the same extent as it was done for 'fo:block'. fo:list-item ------------ The following properties are supported: Margin Properties (vertical margins only) break-before break-after ISSUE: The support for 'background-color', Border Properties and Padding Properties should be implemented at the same extent as it was done for 'fo:block'. fo:list-item-block ------------------ No individual properties supported. Note that the 'start-indent' property, as well as 'body-start()' function suggested by XSL WD are not supported. The XSL WD specification on this subject appears to be somewhat controversial, since 'start-indent' is not listed among the properties allowed for 'fo:list-item-block'. fo:list-item-label ------------------ No individual properties supported. Item labels are treated as a boxes (and therefore cannot be split between pages). Note that the 'end-indent' property, as well as 'label-end()' function suggested by XSL WD are not supported. The XSL WD specification on this subject appears to be somewhat controversial, since 'end-indent' is not listed among the properties allowed for 'fo:list-item-label'. 8. Link an Multi Formatting Objects ----------------------------------- fo:simple-link -------------- This formatting object class is handled with the fallback. Content is promoted to the parent formatting object. fo:multi-switch --------------- This formatting object class is handled with the fallback. Contents of the first eligible multi-case formatting object is utilized. fo:multi-case ------------- This formatting object is used as a wrapper for the fallback for multi-switch. The following properties are supported: starting-state fo:multi-toggle --------------- This formatting object class is handled with the fallback. Content is promoted to the parent formatting object. fo:multi-properties ------------------- This formatting object class is handled with the fallback. Content is promoted to the parent formatting object. fo:multi-property-set --------------------- This formatting object class is handled with the fallback. It is ignored by the processor. 9. Out-of-Line Formatting Objects --------------------------------- fo:float -------- This formatting object class is handled with the fallback. It is placed inline. fo:footnote ----------- This formatting object class is handled with the fallback. It is placed inline. fo:footnote-body ---------------- This formatting object class is handled with the fallback. It is placed inline. 10. Other Formatting Objects ---------------------------- fo:wrapper ---------- This formatting object may be used to specify inherited properties for a group of formatting objects. fo:marker --------- This formatting object class is handled with the fallback. It is ignored by the processor. fo:retrieve-marker ------------------ This formatting object class is handled with the fallback. The processor displays indication that content cannot be correctly rendered. Appendix A. New in this Release ------------------------------- Since 12-Sep-2000 ----------------- Added support for the variable (auto) height of 'fo:table-row'. Added support for the following properties: linefeed-treatment space-treatment text-indent white-space-collapse Added support for the following shorthand properties: border-width border-color border-style border-top border-right border-bottom border-left border font margin padding white-space Added support for percentage property values. Since 15-Sep-2000 ----------------- List Formatting Objects fo:list-block fo:list-item fo:list-item-label fo:list-item-body and related properties provisional-distance-between-starts provisional-label-separation are implemented. Implementation problems of 'fo:external-graphic' are fixed. The 'text-align' and 'vertical-align' properties are implemented for 'fo:external-graphic'. Since 29-Sep-2000 ----------------- The following formatting objects are implemented: fo:declarations fo:character fo:leader fo:table-and-caption fo:table-caption fo:wrapper Several additional properties are related to these objects are implemented as well. Fallbacks implemented for all unsupported formatting objects.