|
The Formatting Object Tree is interpreted into the Refined Formatting Object Tree that is comprised of objects and traits. Properties can specify two kinds of traits: formatting traits (e.g. size and position) or rendering traits (e.g. style and appearance). Some property specifications are shorthand expressions that encompass a number of separate trait specifications and their values.
Computed property expression values are evaluated and the resulting values assigned to the traits. For example a property value of 2em when the current font size is 20pt produces a trait value of 40pt.
Inheritance plays an important role in trait derivation. Some traits are derived from the closest ancestral corresponding property specification. Some traits that are not inherited by default can have their value inherited by the explicit inherit property value.
Once all traits that are applicable to all formatting objects are determined, all traits not applicable to each object are removed. At this point the information is comprised of all objects that are used to create areas and each object has all the traits and only the traits that are applicable to them.
The Refined Formatting Object Tree is interpreted into the Area Tree that is comprised of areas and traits. A given object may create areas at different branches of the Area Tree. Most objects produce exactly one area, and some objects do not produce any areas.
Each area has a geometric position, z-layer position, content, background, padding and borders. Areas are nested in the tree within ancestral areas up to the highest (and largest) area which is the page area.
Page areas are the children of the root node in the Area Tree. Page areas are ordered by their position in the Area Tree, but they are not geometrically related to each other in any way.
The rendering agent effects the impartation of the areas in the Area Tree according to the medium. The Recommendation gives guidelines on the rendering of areas in either visual or aural media. Some missing trait values can be arbitrarily inferred by the rendering agent, such as font or volume. This allowance leads to differing renderings by different tools when an XSLFO instance does not express the missing trait values.
The Recommendation document is written to direct a formatter implementer in carrying out the requirements of interpreting the formatting intent. Certain traits are boolean values targeted solely to the implementer and reflecting an area's role or relative order to other areas. These traits are not specifiable in the XSLFO instance but are indicated in the Recommendation to make implementation easier.
The rigor of the Recommendation language is necessary in order to ensure proper interpretation of finely-tuned typographical nuances. This makes the Recommendation difficult to read for many people just wanting to write stylesheets. Fortunately, simple things can be done simply once you get around the necessary verbosity of the Recommendation document.
This is a prose version of an excerpt from an edited version of the book "Practical Formatting Using XSLFO" (First Edition ISBN 1-894049-07-1 at the time of this writing) published by Crane Softwrights Ltd., written by G. Ken Holman. |
|