Copyright © 2010 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
The Extensible Stylesheet Language (XSL) has two parts:
a language for transforming XML documents (XSLT), and
an XML vocabulary for specifying formatting semantics (XSL-FO).
This document describes features and changes introduced for version 2.0 of the XSL-FO part of XSL.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This document is a Working-Group Draft containing proposals for an eventual XSL-FO 2.0 Recommendation. Changes since the previous version can be found in Appendix A. Public feedback is solicited. The Working Group (actually the Formatting Objects Subgroup) is short of resources, and would be interested in organizations or individuals in a position to help us work on the Specification.
Comments on this document should be made using bugzilla, at bugzilla; comments can also be sent by email to xsl-editors@w3.org (see the public archive), and members of the XSL-FO Task Force will enter them into bugzilla; see www.w3.org/XML/2008/xsl-fo-bugzilla.html for instructions on using bugzilla to report issues.
Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document has been produced as part of the W3C XML Activity by the XSL Working Group.
General public discussion of XSL takes place on the XSL-List and on the www-xsl-fo@w3.org mailing lists; the www-xsl-fo list is probaby most appropriate for general questions about the 2.0 work.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
1 Introduction and Overview
2 Pagination and Layout
2.1 Non-rectangular areas
2.1.1 fo:page-master
2.1.2 fo:shape
2.1.3 fo:region
2.1.4 fo:shape-name-specifier
2.1.5 fo:shape-path-specifier
2.1.6 fo:shape-background-specifier
2.1.7 fo:shape-border-specifier
2.1.8 Common Wrap Properties
2.1.8.1 wrap
2.1.8.2 wrap-path
2.1.8.3 wrap-side
2.2 Copyfitting
2.2.1 Summary
2.2.2 Copyfit: basic approach and definitions
2.2.3 Copyfit Examples
2.2.4 Content Adjusting Strategies
2.2.5 Objects and properties for copyfit
2.2.5.1 adjustable-properties
2.2.5.2 Value list simplification
2.2.5.3 Priority
2.2.5.4 fo:alternative-copyfit-content
2.3 Initial Caps
2.3.1 Initial Caps
2.3.1.1 initial-cap-lines
2.3.1.2 initial-cap-lines-before
2.3.1.3 initial-cap-kern-lines
2.3.1.4 initial-cap-indent
2.4 Marginalia
2.4.1 Extension Regions
2.4.1.1 The extension-region-start Region
2.4.1.2 The extension-region-end Region
2.4.1.3 distance
2.4.2 Formatting Objects for Marginalia
2.4.2.1 fo:marginalia
2.4.2.2 fo:marginalia-body
2.4.2.3 marginalia-destination-area
2.4.2.4 marginalia-relative-align
2.5 Vertical Positioning
2.5.1 Feathering
2.5.2 Correlating vertical position
2.5.2.1 block-unit
2.5.3 Vertical alignment within a page or column
2.5.4 Vertical alignment specific for the last column
2.5.4.1 display-align-last-column
2.5.5 Vertical justification across pages and columns
2.5.6 display-align
2.5.7 display-align-last
2.6 Tables and Lists
2.6.1 Decimal Alignment
2.6.1.1 Considerations
2.6.2 Table header/footer on boundaries
2.6.2.1 fo:conditional-table-layout-reference
2.6.2.2 Split tables
2.6.2.2.1 table-overflow
2.6.2.3 Repeat contents of split spanned cell
2.6.2.4 Cell borders extending beyond the table
2.6.2.4.1 3.5.1 Considerations
2.6.2.5 Adjacent borders
2.6.2.6 Borders on break
2.6.2.7 Spanning cell over all row and columns
2.6.3 Columns
2.6.3.1 column-count
2.6.3.2 fo:column-definitions
2.6.3.3 fo:column-definition
2.6.3.4 fo:column-gap
2.6.3.5 Example of Columns
2.6.4 Layout master set
2.6.4.1 Interleaving layout-master set
2.6.4.1.1 Formatting Objects Summary
2.6.4.1.2 "Declarations and Pagination and Layout Formatting Objects" introduction
2.6.4.1.3 fo:root
2.6.4.1.4 fo:page-sequence
2.6.4.1.5 fo:layout-master-set
2.6.4.1.6 'master-name'
2.6.4.1.7 'master-reference'
2.6.4.1.8 'flow-name'
2.6.4.1.9 'flow-name-reference'
2.6.4.1.10 'region-name'
2.6.4.1.11 'region-name-reference'
2.6.4.2 Change master every n pages
2.6.4.2.1 sequence-repeats
2.6.4.2.2 page-position
2.6.4.2.3 fo:repeatable-page-master-alternatives
2.6.4.2.4 fo:conditional-page-master-reference
2.6.5 Spreads
2.6.5.1 fo:spread-page-master
2.6.5.1.1 Would also affect text in:
2.6.6 Bleeds and Trim
2.6.6.1 bleed-box, trim-box
2.7 Side by Side
2.7.1 flow-map-dependency-reference
2.7.1.1 flow-map-dependency-reference
2.7.2 Common Dependencies Properties for Formatting Objects
2.7.2.1 dependency-content-start
2.7.2.2 dependency-content-end
2.7.2.3 Content Boundaries Stacking Control
2.7.2.4 dependency-content-stacking-strategy
2.7.3 Widow and Orphan Management
2.7.3.1 keep-with-dependent-content
2.8 Numbering
2.8.1 fo:number
2.8.2 name
2.8.3 level
2.8.4 reset-level
2.8.5 initial-value
2.8.6 interval
2.8.7 reset-value
2.8.8 display-when
2.8.9 display-position
2.8.10 number-align
2.8.11 number-area-extend
2.8.12 text-align
2.8.13 text-decoration
2.8.14 font-family
2.8.15 font-size
2.8.16 font-style
2.8.17 font-weight
2.8.18 color
2.8.19 background-color
2.8.20 format
2.8.21 decimal-format
2.8.22 letter-value
2.8.23 ordinal
2.8.24 country
2.8.25 language
2.8.26 grouping-separator
2.8.27 grouping-size
2.8.28 Arbitrary Object Numbering
2.8.28.1 format
2.9 fo:retrieve-number
2.9.1 name
2.9.2 value
2.9.3 Other Properties
2.10 fo:decimal-format
2.11 Examples
3 Expressions
4 Inheritance
5 Composition
5.1 Improved font support
5.2 Force line justification
5.2.1 last-line-minimum-deficit
5.2.2 hyphenation-permitted-minimum-deficit
5.3 Alignment around breaks
5.3.1 text-align-before-break
5.3.2 text-align-after-break
5.4 hanging-punctuation
5.5 Tabs and tab stops
5.5.1 tab-stops
5.5.2 tab-alignment-character
5.6 Word and letter spacing
5.6.1 word-spacing-critical-length
5.7 Hyphenation and line breaking
5.7.1 hyphenation-push-syllable-count
5.7.2 hyphenation-remain-syllable-count
5.7.3 syllable-widows
5.7.4 hyphenation-exceptions
5.7.5 word-widows
5.7.6 min-length-of-last-line
6 Further improved non-Western language support
6.1 Ruby
6.1.1 Ruby and Areas
6.1.2 Ruby Formatting Objects
6.1.2.1 fo:ruby
6.1.2.2 fo:ruby-base
6.1.2.3 fo:ruby-text
6.1.2.4 fo:ruby-parenthesis
6.1.2.5 fo:ruby-base-container-text
6.1.2.6 fo:ruby-text-container
6.1.3 Ruby Properties
6.1.3.1 ruby-position
6.1.3.2 ruby-alignment
6.1.3.3 ruby-group-distribution
6.1.3.4 ruby-alignment-edge
6.1.3.5 ruby-align
6.1.3.6 ruby-overhang
6.1.3.7 ruby-overhang-length
6.1.3.8 ruby-span
6.1.3.9 ruby-size
6.1.3.10 ruby-proportion
6.1.3.11 ruby-mode
6.1.4 Block and Line-related Properties
6.1.4.1 line-stacking-annotation
7 Images
7.1 Images
7.1.1 Rotate an image by arbitrary amounts
7.1.2 Callouts
7.1.3 Multi-page images
8 Color Support
9 Collaboration with SVG
9.1 Masks
9.2 Rotation and Transformations
10 Other changes
A Changes since last publication
B References
B.1 Normative References
B.2 Other References
C List of properties (Non-Normative)
D Acknowledgements (Non-Normative)
This document describes initial design notes for version 2.0 of the Formatting Object (FO) part of the Extensible Stylesheet Language (XSL). The final document will be a complete specification, but the early Working Drafts, including this one, give only design notes and discussion of new features and changes.
There are a number of open issues in this document; please let us (the XSL-FO subgroup of the XSL Working Group) know if you have comments on them, using bugzilla: see the Status section at the start of this document for instructions.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.1.1
Add support for non-rectangular areas wherever appropriate. This is for areas where the content needs to be flowed inside an non-rectangular shape.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.1.2
Run text on a path including flowing from one path to another. This goes further than simply including SVG, as we're also supporting the line breaking rules that XSL-FO provides. Text should be able to flow from one line to the next line of the multiline paths but it needs to be explicitly specified what each line of the path is, as we do not intend to stack paths automatically. The intent is to apply the normal line building properties to text on a path.
(This draft does not yet address this requirement)
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.1.2
Add support for runarounds or intrusions (text flowing around illustrations, regions and other objects). This is related to effects obtained by overlapping areas of either rectangular or non-rectangular shape in any suitable combination, but it doesn't really require non-rectangular areas.
Allow one object to intrude into another.
Support intrusions into all 4 sides
Support specifying pull-quotes without the need to repeat the content of the pull-quote. This is related to 2.2.9.4 Generalized markers [and will be addressed in that section]
Support cut-outs
The objects (both the intruder as well as the object intruded upon) may be of arbitrary shape
Allow users to specify the relations between the objects that are impacted by the intrusion
For non-rectangular areas, XSL-FO 2.0 uses shapes expressed in SVG [SVG]. Regions and block containers can have associated shapes.
Intrusions and cut-outs are seen as two ways of looking at one shape affecting another, and are both modeled as intrusions.
Relative priority between shapes is handled using the z-index property.
Common Usage:
The fo:page-master is used in the generation of pages and specifies the geometry of the page. The page may be subdivided into an arbitrary number of regions, each called an fo:region.
Note:
The region has similar behaviour to a region-body, this means that an fo:page-master is formed by an arbitrary number of body-like regions. Regions are positioned absoulutely into the page and have a concept of z-index.
Areas:
The fo:page-master formatting object generates no area directly. It is used in the generation of pages by an fo:page-sequence.
When the fo:page-master is used to generate a page, a viewport/reference pair is generated, consisting of a page-viewport-area and a page-reference-area. The page-viewport-area represents the physical bounds of the output medium. The page-reference-area represents the portion of the page on which content is intended to appear; that is, the area inside the page margins.
In addition, when the fo:page-master is used to generate a page, viewport/reference pairs that correspond to the regions that are the children of the fo:page-master are also generated.
Figure 1. The z-index property. A large shape called Region A is filled with text, and has z-index of zero. A smaller shape, called region B, wholly contained within region A, also contains text (coloured red). Region B has a z-index of 1, so that the text in region A is pushed away from it. If both regions had the same z-index, the text would ovelap. A third region, region C (coloured green) has z-index of 2, and forces the text in the other two regions to avoid it.
Trait Derivation:
Same as fo:simple-page-master
Constraints:
Same as fo:simple-page-master
Contents:
(region)+
The following properties apply to this formatting object:
[7.10 Common Margin Properties-Block]
[7.xx.1 "bleed-box"]
[7.25.8 "master-name"]
[7.25.13 "page-height"]
[7.25.15 "page-width"]
[7.20.3 "reference-orientation"]
[7.xx.2 "trim-box"]
[7.27.7 "writing-mode"]
Common Usage:
Used in constructing a shape outline. This object defines a shape using a child from a SVG Documents to describe the region's shape. The permitted structure of this child is that defined for that namespace.
The definition of the shape using the fo:shape permits the shape re-use among different regions similarly to the concept of page-masters.
The fo:shape may define background, border and padding properties. These are applied to the SVG shape's path. In the case the SVG shape already defines a border (using the stroke attribute) and/or a background (using a fill attribute) the fo properties are overimposed to the SVG document.
Contents:
The fo:shape object has a child from an SVG Document to describe a region's shape. The permitted structure of this child is that defined by SVG [SVG].
Example 1: Path based shape
<fo:shape shape-name="trapezoid"> <svg:svg xmlns:svg="http://www.w3.org/2000/svg"> <svg:path d="M ... z " /> </svg:svg> </fo:shape> <fo:shape shape-name="free-hand"> <svg:svg xmlns:svg="http://www.w3.org/2000/svg"> <svg:path d="M ... z" /> </svg:svg> </fo:shape>
Example 2: Showing border, padding and background.
<fo:shape shape-name="circle" border-width="2pt" border-color="black" padding-width="10pt"> <svg:svg xmlns:svg="http://www.w3.org/2000/svg"> <circle cx="250" cy="250" r="200"/> </svg:svg>> </fo:shape>
Figure 2. The bounding box of a shaped region is the smallest rectangle that completely contains the shape, and is here called the region bounding-box. The border and padding follow the outline of the shape itself.
The following properties apply to this formatting object:
[7.10 Common Margin Properties-Block]
[7.xx.1 "bleed-box"]
[7.25.8 "master-name"]
[7.25.13 "page-height"]
[7.25.15 "page-width"]
[7.20.3 "reference-orientation"]
[7.xx.2 "trim-box"]
[7.27.7 "writing-mode"]
Common Usage:
Used in constructing a page-master, the behavior of each fo:region is similar to the behavior of fo:region-body of XSL-FO 1.1. A region specifies a viewport/reference pair that is located in an absoulte position within the fo:page-master. The "overflow"trait controls how much of the underlying region-reference-area is visible; that is, whether the region-reference-area is clipped by its parent region-viewport-area.
Note:
Typically, for paged media, the areas returned by the fo:flow formatting object in a fo:page-sequence are made to be descendants of a sequence of region-reference-areas that correspond to region-bodies. These region-reference-areas are all area descendants of page-areas for which the page-master included an fo:region-body. If the fo:flow flow is assigned to some other region, then the areas returned by the fo:flow are constrained to be descendants of region-reference-areas generated using the assigned region-master.
The fo:region may be divided into multiple columns.
When the column-count
trait is greater than one
the region will be subdivided into multiple columns.
Areas:
Same as fo:region-body
Trait Derivation:
Same as fo:region-body
Constraints:
Same as fo:region-body
Contents:
(shape-name-specifier, shape-path-specifier?, shape-background-specifier*, shape-border-specifier*)
Example
<fo:page-master master-name="only" page-height="11in" page-width="8.5in" margin-top="3pt" margin-bottom="3pt" margin-left="3pt" margin-right="3pt"> <fo:region absolute-position="absolute" top="0.8636in" left="1.125in" width="6.75in" height="7.75in" region-name="region_A" z-index="0" wrap="shape" wrap-sides="both" wrap-path="shape"> ... shape reference specifier(s) ... </fo:region> <fo:region absolute-position="absolute" top="1.3in" left="1.4in" width="3.6in" height="5.4in" region-name="region_B" z-index="1"> ... shape reference specifier(s) ... </fo:region> </fo:page-master>
The following properties apply to this formatting object:
[7.5 Common Absolute Position Properties]
[7.7 Common Border, Padding, and Background Properties]
[7.10 Common Margin Properties-Block]
[7.1x Common Wrap Properties]
[7.20.1 "clip"]
[7.25.2 "column-count"]
[7.25.3 "column-gap"]
[7.13.4 "display-align"]
[ 7.15.6 "height"]
[7.20.2 "overflow"]
[7.25.17 "region-name"]
[7.20.3 "reference-orientation"]
[7.15.14 "width"]
[7.27.7 "writing-mode"]
[7.28.9 "z-index"]
The shape assignment model allows a region to point to one or more regions that are used to define:
content path: where the region's content is bound to wrap
wrapping path: where the region's intruded content is bound to wrap around
border: one or more shapes used to define a border that is beyond standard FO border capabilities or it is designed ad-hoc
background: one or more shapes used to define a background effect that is beyond standard FO background capabilities
Note:
This draft does not yet cover the interactions between non-rectangular shapes and footnotes.
Shape assignment model illustration
Example 3. Full Shape and Region use and re-use.
<fo:layout-master-set> <fo:shape shape-name="hexagon"> <svg:svg xmlns:svg="http://www.w3.org/2000/svg"> <svg:path d="M ... z " /> </svg:svg> </fo:shape> <fo:shape shape-name="intruder-bag"> <svg:svg xmlns:svg="http://www.w3.org/2000/svg"> <svg:path d="M ... z " /> </svg:svg> </fo:shape> <fo:shape shape-name="border-bag"> <svg:svg xmlns:svg="http://www.w3.org/2000/svg"> <svg:path d="M ... z " /> </svg:svg>> </fo:shape> <fo:shape shape-name="bag"> <svg:svg xmlns:svg="http://www.w3.org/2000/svg"> <svg:path d="M ... z " /> </svg:svg> </fo:shape> <fo:page-master master-name="only" page-height="11in" page-width="8.5in" margin-top="3pt" margin-bottom="3pt" margin-left="3pt" margin-right="3pt"> <fo:region absolute-position="absolute" top="0.8636in" left="1.125in" width="10in" height="12in" region-name="region_A" z-index="0"> <fo:shape-name-specifier shape-name-reference="bag" width="100%" height="100%" display-align="center" /> <fo:shape-path-specifier shape-name-reference="intruder-bag" width="100%" height="100%" display-align="center" /> <fo:shape-border-specifier shape-name-reference="border-bag" width="100%" height="100%" display-align="center" /> <fo:fo:shape-background-specifier shape-name-reference="hexagon" width="80%" height="80%" relative-position="relative" top="6in" left="6in" /> <fo:fo:shape-background-specifier shape-name-reference="hexagon" width="60%" height="60%" relative-position="relative" top="4in" left="4in" /> <fo:fo:shape-background-specifier shape-name-reference="hexagon" width="40%" height="40%" relative-position="relative" top="2in" left="2in" /> <fo:fo:shape-background-specifier shape-name-reference="hexagon" width="20%" height="20%" relative-position="relative" top="1in" left="1in" /> </fo:region> </fo:page-master> </fo:layout-master-set>
Common Usage:
The fo:shape-name-specifier element is used to name a shape for the applicable region or block container, and also to constrain the width and height for that shape.
Contents
EMPTY
The following properties apply to this formatting object:
[shape-name-reference similar to flow-name-reference]
[7.13 Common Relative Position Properties]
[7.13.4 "display-align"]
[ 7.15.6 "height"]
[7.15.14 "width"]
Common Usage:
The fo:shape-path-specifier is used to specify the intrusion path created from this region when intruding other regions.
Contents
EMPTY
The following properties apply to this formatting object:
[shape-name-reference similar to flow-name-reference]
[7.13 Common Relative Position Properties]
[7.13.4 "display-align"]
[ 7.15.6 "height"]
[7.15.14 "width"]
Common Usage:
The fo:shape-background-specifier is used to specify the backround shape design.
Contents:
EMPTY
The following properties apply to this formatting object:
[shape-name-reference similar to flow-name-reference]
[7.13 Common Relative Position Properties]
[7.13.4 "display-align"]
[ 7.15.6 "height"]
[7.15.14 "width"]
Common Usage:
The fo:shape-border-specifier is used to specify the backround shape design.
Contents:
EMPTY
The following properties apply to this formatting object:
[shape-name-reference similar to flow-name-reference]
[7.13 Common Relative Position Properties]
[7.13.4 "display-align"]
[ 7.15.6 "height"]
[7.15.14 "width"]
The common wrap properties are used to express the runaround interaction between regions. Regions interact based on their z-index values. Regions with higher z-index are considered overlapping regions with lower z-index.
wrap
XSL Definition:
Value: | skip | path | none |
---|---|
Initial: | skip |
Percentages: | N/A |
Applies to: | fo:region |
Inherited: | no |
Media: | visual |
Use the "wrap" property to specify flow run-around.
Values have the following meanings:
This is the default behavior. The content in the flow will skip the entire intrusion area continuing from the first available un-intruded allocation area
The runaround contour is determined following the wrap-path property strategy
No runaround is applied. If regions are overlapping their content will overlap.
Open issue: 8859
this also needs to relate to floats: we have basically defined a sort of centre float here. Should we allow float: left/right/none to take a percentage too?
wrap-path
XSL Definition:
Value: | shape | bounding-box | auto |
---|---|
Initial: | shape |
Percentages: | N/A |
Applies to: | fo:region |
Inherited: | no |
Media: | visual |
When two or more shaped areas interact, the "wrap-path" property determines how text and other inline objects in one area flow around the shape of the other area.
Values have the following meanings:
This is the default behavior. The path is custom and it is indicated using the shape-path-specifier within the shape-assignment for the region. If there is no shape-map associated with the intruded region the behaviour is defaulted to bounding-box.
The path is determined by the bounding-box of the overlapping region
The path is inferred as follows:
clip-path embedded in the content of the intruding region.
path detection through image color threshold or alpha-channel (transparency) in the content in the intruding region.
If neither of these are available, or the implementation does not support them, the path is defaulted to the bounding-box.
wrap-side
XSL Definition:
Value: | all | start | end | inside | outside | largest | smallest |
---|---|
Initial: | shape |
Percentages: | N/A |
Applies to: | fo:region |
Inherited: | no |
Media: | visual |
The "wrap-side" property indicates what strategy should be applied for the runaround.
Values have the following meanings:
This is the default behavior. Runaround is performed, if possible, on both sides of the intruding area.
The run-around is performed only in the start side of the intruding area.
The runaround is performed only in the end side of the intruding area.
The runaround is performed only in the inside of
the intruded area. The inside is the side nearer to the
spread "spine". The spread spine is considered the contact
line between the two pages forming the spread. If the
region is not part of a spread the inside value is
interpreted as nearest to the binding edge, as for
text-align
.
The runaround is performed only in the outside of
the intruded area. The outside is determined as
elsewhere, e.g.
text-align
.
The runaround is performed only in the largest area available as result of the intrusion.
The runaround is performed only in the smallest area available as result of the intrusion.
Note:
What about V-shaped or W-shaped intrusions?
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.1.4
Add support for copyfitting, for example to shrink or grow content (change properties of text, line-spacing, ...) to make it constrain to a certain area. This is going to be managed by a defined set of properties, and in the stylesheet it will be possible to define the preference and priority for which properties should be changed. That list of properties that can be used for copyfitting is going to be defined.
Additionally, multiple instances of alternative content can be provided to determine best fit.
This includes copyfitting across a given number of pages, regions, columns etc, for example to constrain the number of pages to 5 pages.
Add the ability to keep consistency in the document, e.g. when a specific area is copyfitted with 10 pt fonts, all other similar text should be the same.
Allowing copyfitting on fo:region, fo:region-* objects, fo:block-container and fo:table-cell.
Adding a new value ("justify") for the property "display-align" (already in XSL-FO) to activate copyfitting. Though the same property is used for vertical justification, users can exploit the property "force-page-count" (along with a correct definition of page-masters and page-sequences) to avoid conflicts.
Introducing the concept of “list of prioritized adjustable properties”. An adjustable property is an existing XSL-FO property that can be modified in order to do copyfitting or vertical justification.
Exploiting range values of existing properties to specify how (and how much) each property can be adjusted. Introducing the idea of "elasticity".
Adding a new property "adjustable-properties" that specifies such lists.
Adding new values to the property "force-page-count" to model copyfit into a fixed number of pages or a multiple of a number.
Adding a new formatting object fo:alternative-copyfit-content to express alternative content for copyfitting
Note:
How to express consistency and relationships among copyfitted areas? how to copyfit irregular shapes?
Note:
how to express alternative content: what happens if it is not possible? how to express consistency and relationships among copyfitted areas? how to copyfit irregular shapes?
Many options exist to copyfit content to a certain area. For example, a user could add some space between paragraphs, widen or narrow spaces before and after titles, images and tables, modify the line height of some paragraphs, etc. All these fine tunings, and their multiplicity of combinations, lead to different results, and different users could have different preferences.
Thus, copyfitting actually requires two logically separated tasks: (1) the request of copyfitting to a given area, and (2) the definition of strategies to copyfit.
Copyfitting is enabled by setting
the property display-align
to the value "justify".
Copyfitting strategies are then expressed
through "adjustable properties lists"
using the.
adjustable-properties
property.
Although the same approach is used for vertical justification,
users can exploit the property
force-page-count
and/or
the definition of page-masters and page-sequences to avoid conflicts.
The display-align
property applies to
fo:region, fo:region-*, fo:block-container and fo:table-cell.
It is then possible to copyfit content in a block-container
or in a table cell,
and also to copyfit the content of one flow to a single region,
multiple flows to a single region or even
multiple flows to multiple regions.
A
display-align-last
property is also added,
to specify different treatment of the last page in a
copyfitted seqence,
by analogy with
text-align
and
text-align-last
.
Let us first consider two flows A and B that go into two distinct regions R1 and R2, as defined in the following XSL-FO excerpt:
<?xml version="1.0" encoding="UTF-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:page-master master-name="sample1" page-height="11in" page-width="8.5in" margin-top="3pt" margin-bottom="3pt" margin-left="3pt" margin-right="3pt"> <fo:region region-name="R1" display-align="justify" adjustable-properties="line-height"/> <fo:region region-name="R2" display-align="before"/> </fo:page-master> <fo:flow-map flow-map-name="M1"> <fo:flow-assignment> <fo:flow-source-list> <fo:flow-name-specifier flow-name-reference="A"/> </fo:flow-source-list> <fo:flow-target-list> <fo:region-name-specifier region-name-reference="R1"/> </fo:flow-target-list> </fo:flow-assignment> <fo:flow-assignment> <fo:flow-source-list> <fo:flow-name-specifier flow-name-reference="B"/> </fo:flow-source-list> <fo:flow-target-list> <fo:region-name-specifier region-name-reference="R2"/> </fo:flow-target-list> </fo:flow-assignment> </fo:flow-map> <fo:page-sequence force-page-count="1" flow-map-reference="M1"> <fo:flow flow-name="A"> <fo:block> Lorem maecenas blandit ac, neque sed ut pulvinar, lectus sagittis sapien per risus vel. Ligula sapien sed morbi cras tellus commodo. Si qua ex docet dei etris crucis</fo:block> <fo:block> curabitur magna nisi, faucibus sed ornare sed, congue eu dui. Pellentesque habitant morbi tristique senectus et netus et malessecularia uada fames ac turpis egestas. </fo:block> <fo:block> Nunc sit amet dolor sed sem congue mattis sed ut arcu. Mauris id magna sit amet elit aliquam.</fo:block> <fo:block>Pellentesque habitant morbi tristique senectus et netus et malesuada fames.</fo:block> </fo:flow> <fo:flow flow-name="B"> <fo:block>Crucis rosa ut hoc sien qua non res veni.</fo:block> <fo:block> Etiam tristique, nulla a pulvinar hendrerit nihil tortor urna auctor etim domine secularia cali sed ut quotie ire in domince hoc fantus quis eius rei rei. </fo:block> </fo:flow> </fo:page-sequence> </fo:root>
The property
display-align
is added to the element
"fo:region"
to activate copyfit for region R1. No copyfit is activated on
region R2 since the property
display-align
has value "before".
Note also that the property force-page-count
of the element "fo:page-sequence"
states that the overall content has to be copyfitted in one page.
Finally, the property
adjustable-properties
lists those XSL-FO properties that can be modified to copyfit text.
The expected result is shown below:
The same flows and regions are expected to produce a different output, when the flow-map M2 is used instead:
<fo:flow-map flow-map-name="M2"> <fo:flow-assignment> <fo:flow-source-list> <fo:flow-name-specifier flow-name-reference="A"/> <fo:flow-name-specifier flow-name-reference="B"/> </fo:flow-source-list> <fo:flow-target-list> <fo:region-name-specifier region-name-reference="R1"/> <fo:region-name-specifier region-name-reference="R2"/> </fo:flow-target-list> </fo:flow-assignment> </fo:flow-map>
In this case, the two flows go into region R1 and then region R2.
If the properties
display-align
does not change, the expected result is the following:
The expected result is different when either the property "display-align" of region R2 is set to "justify":
<fo:page-master master-name="sample1" page-height="11in" page-width="8.5in" margin-top="3pt" margin-bottom="3pt" margin-left="3pt" margin-right="3pt"> <fo:region region-name="R1" display-align="justify" adjustable-properties="line-height"/> <fo:region region-name="R2" display-align="justify"/> </fo:page-master>
In fact, both the regions end up being copyfitted as shown below:
When the formatter is expected to produce as many pages as needed
(for instance, by setting the property
force-page-count
to "no-force"),
the property
display-align
is used to activate
vertical justification.
The property display-align-last
is then
used to set the vertical alignment of the last page.
Let us consider the following example, where only one region R1 and one flow A are declared:
<?xml version="1.0" encoding="UTF-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:page-master master-name="sample1" page-height="11in" page-width="8.5in" margin-top="3pt" margin-bottom="3pt" margin-left="3pt" margin-right="3pt"> <fo:region-body region-name="xsl-region-body" display-align="justify" display-align-last="relative" adjustable-properties="..."/> </fo:page-master> <fo:page-sequence> <fo:flow flow-name="A"> <fo:block>Lorem ipsum dolor sit amet, nunc euismod nisl nam euismod, quis maecenas blandit ac, neque sed ut pulvinar, lectus sagittis ... quorneque tortor neque, commodo mauris sagittis yurpis,hic fecit leuc em.</fo:block> <fo:block>Lorem ipsum dolor sit amet, nunc ... lectus sagittis sapien mauris per risus.</fo:block> <fo:block>Ligula sapien sed morbi cras tellus ... quoque cra ut sic fecit quorem deis hoc hac lorem ipse die cruci faucibus sed ultrices tempor inter dum.</fo:block> <fo:block>Lorem ipsum dolor sit amet, .... Rutrum mattis accumsan.</fo:block> </fo:flow> </fo:page-sequence> </fo:root>
The values of the properties
display-align
and display-align-last
of the element "fo:region-body"
require the formatter to produce the following output:
By setting the property display-align-last
to "justify",
the last page is also vertically justified:
Note also that this case can be easily generalized for the case of multiple flows going into the same region.
The formatter is expected to copyfit text in a given number of pages when the property
force-page-count
is set to an integer value.
Consider for instance the previous declaration of
"fo:region-body" changed into:
<fo:region-body region-name="xsl-region-body" display-align="justify" display-align-last="justify" force-page-count="2" adjustable-properties="..."/>
The formatter is now expected to produce the following result:
The last page is vertically justified since the property
display-align-last
is set to "justify".
By changing that property, user can obtain the same number of pages
without imposing the last one to be completely filled.
A more complex example is shown below, summarizing multiple cases:
XSL-FO provides a general mechanism to express strategies for copyfitting or vertical justification. The overall approach is flexible and independent on the formatting task and may be applied to other contexts in the future.
An "adjustable properties list" is an ordered sequence of properties names (or group of names) that a formatter is allowed to modify to format the content. In fact, such lists are used to drive copyfitting, vertical justification and feathering. The order of the names in the list follows the priority rules described below.
Adjustable properties lists can be associated with fo:objects
using the property adjustable-properties
.
It is important to note that the “adjustable-properties list” only states the strategy to format the content and does not define the actual property ranges the application is allowed to modify. These are instead expressed (as in an XSL-FO 1.1 document) throughout the flow and its descendant formatting objects: this provides a great expressing power in a simple way, as, for example, it allows for different fo:block elements to have different adjusting properties.
For example: adjustable-properties=”space-before word-spacing” means that the application is allowed to modify the actual value of the space-before and word-spacing properties. Although the “adjustable-properties” property is defined in the fo:flow-assignment object, the variations are defined in the “space-before” and “word-spacing” properties of the blocks within the actual flow. In most cases values of these properties are actually inherithed. The application should try to adjust the text by choosing appropriate values for the space-before traits (using a value either greater or smaller that the .optimum one but still between the relevant .minimum and .maximum) of each block.
In fact, many FO properties (dating back to the initial XSL-FO specification) can be given a length range value, expressed using a .minimum, .optimum and .maximum components; others (allowed-height-scale, allowed-width-scale) can be given a list of numeric values; font-family can be given a list of values.
A property having a range value can create some elasticity: the dimensions of the areas generated by the affected formatting objects can stretch or shrink from an optimal value. An FO subtree is said to have inline elasticity if there are properties involved in the line building process that have some degree of elasticity; similarly, an FO subtree is said to have block elasticity if there are properties involved in the block stacking process that have some degree of elasticity. It should be noted that a length range in an inline-related property can involve both inline and block elasticity (as, for example, a variation in word-spacing may result in the creation of fewer or more lines), while a range in a block-related property only creates block elasticity.
The presence of some elasticity is the first condition to adjust content (for copyfitting or vertical justification). Properties with range or list values, in fact, can be adjusted in order to achieve the expected result.
On the other hand, elasticity does not automatically imply that content will be formatted as expected. It may happen that properties listed in “adjustable properties list” do not have elasticity while other do. In that case the formatter cannot achieve the expected result and should warn the user.
If properties listed in the “adjustable properties list” do have elasiticy but the formatter is not able to achieve the expected result – because of syntax errors, limitated support of required strategies, etc. – the formatter should warn the user too.
An example of copyfit declaration and application is shown below:
<?xml version="1.0" encoding="UTF-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:page-master master-name="sample1" page-height="11in" page-width="8.5in" margin-top="3pt" margin-bottom="3pt" margin-left="3pt" margin-right="3pt"> <fo:region region-name="R1" display-align="justify" adjustable-properties="line-height"/> <fo:region region-name="R2" display-align="before"/> </fo:page-master> <fo:flow-map flow-map-name="M1"> <fo:flow-assignment> <fo:flow-source-list> <fo:flow-name-specifier flow-name-reference="A"/> </fo:flow-source-list> <fo:flow-target-list> <fo:region-name-specifier region-name-reference="R1"/> </fo:flow-target-list> </fo:flow-assignment> <fo:flow-assignment> <fo:flow-source-list> <fo:flow-name-specifier flow-name-reference="B"/> </fo:flow-source-list> <fo:flow-target-list> <fo:region-name-specifier region-name-reference="R2"/> </fo:flow-target-list> </fo:flow-assignment> </fo:flow-map> <fo:page-sequence force-page-count="1" flow-map-reference="M1"> <fo:flow flow-name="A"> <fo:block word-spacing.minimum="1pt" word-spacing.maximum="4pt" line-height.minimum="8pt" line-height.maximum="14pt"> Lorem maecenas blandit ac, neque sed ut pulvinar, lectus sagittis sapien per risus vel. Ligula sapien sed morbi cras tellus commodo. Si qua ex docet dei etris crucis</fo:block> <fo:block word-spacing.minimum="1pt" word-spacing.maximum="4pt" line-height.minimum="8pt" line-height.maximum="14pt"> curabitur magna nis, faucibus sed ornare sed, congue eu dui. Pellentesque habitant morbi tristique senectus et netus et malessecularia uada fames ac turpis egestas. </fo:block> <fo:block word-spacing.minimum="1pt" word-spacing.maximum="4pt" line-height.minimum="8pt" line-height.maximum="14pt"> Nunc sit amet dolor sed sem congue mattis sed ut arcu. Mauris id magna sit amet elit aliquam.</fo:block> <fo:block>Pellentesque habitant morbi tristique senectus et netus et malesuada fames.</fo:block> </fo:flow> <fo:flow flow-name="B"> <fo:block word-spacing.minimum="1pt" word-spacing.maximum="4pt" line-height.minimum="8pt" line-height.maximum="14pt">Crucis rosa ut hoc sien qua non res veni.</fo:block> <fo:block word-spacing.minimum="1pt" word-spacing.maximum="4pt" line-height.minimum="8pt" line-height.maximum="14pt"> Etiam tristique, nulla a pulvinar hendrerit nihil tortor urna auctor etim domine secularia cali sed ut quotie ire in domince hoc fantus quis eius rei rei. </fo:block> </fo:flow> </fo:page-sequence> </fo:root>
The two regions R1 and R2 use different strategies to copyfit. Flow A is copyfitted into region R1 by only adjusting the word-space of each block (that will be a value between 1pt and 4pt), while flow B is copyfitted into region R2 by adjusting line-height of each block (that will be a value between 8pt and 14pt).
Notice again that the declaration of the strategies for copyfitting is completely disconnected from the declaration of the copyfit itself.
Note:
The definition of “adjustable-properties” in a fo:flow-assignment object provides great flexibility to the copyfit process (and, similarly, to the vertical justification). In fact, different blocks may have different values of the same property that are all within the allowed ranges. Though any result that satisfies the specified constraints would conform to this specification, current typographic practice would tend to use the available elasticity with uniformity within the same page-sequence or, at least, whitin the same page. So, for example, if two fo:blocks having the same values for space-before happen to generate areas for a copyfitted page, and the application has to use this elasticity, the result most use will expect would have both spaces being set to an identical value.
adjustable-properties
XSL Definition:
Value: | <property-name-list> |
---|---|
Initial: | everything |
Applies to: | fo:region, fo:region-body, fo:region-before, fo:region-after, fo:region-start, fo:region-end, fo:block-container, fo:table-cell |
Inherited: | no |
Percentages: | N/A |
Fallback: | everything |
The adjustable-properties
property is used to define strategies for copyfitting or vertical justification.
It takes effect only if the property
display-align
is set to "copyfit" or "justify".
The value is a whitespace separated list of names (property names and / or shorthand names), possibly grouped in subsets by a single level of parenthesis; formally, it can be defined by these rules:
prioritized-list-of-names = [<priority-group>]* priority-group = <property-name> | <shorthand-name> | ([<property-name> | <shorthand-name>]+)
where a property-name can be the name of any property defined by the FO recommendation;
a shorthand-name stands for a pre-defined sequence of property names:
inline-spacing = word-spacing letter-spacing leader-length
block-spacing = space-before space-after
. . .
any = any property having a range value
An XSL-FO implementation MUST simplify the value list as follows:
remove empty paren pairs, ()
"(" name ")" is equivalent to name
if property-name refers to a property that cannot accept either range values (.minimum, .optimum, .maximum) or multiple values (such as font-family), it can be removed; the application SHOULD warn the user about the uselessness of using that property name, since the value cannot be varied as a part of copyfitting.
if property-name refers to a property which the application is not able to adjust automatically, it can be removed; the application SHOULD warn the user about the application limitation.
if a priority group contains the shorthand "any", than the other property names or shorthand names can be removed
every priority group following "any" MUST be discarded; a processor SHOULD warn the user about any discarded priority groups.
At the end of the simplification process the property value could be the empty list. This means that there is no elasticity that the application is able to handle, and the output will not be formatted as requested. The default value of "any" has been chosen to reduce the likelihood of this.
Items in the simplified value list are given a decresing priority: the first item's priority is greater than that of the second one, and so on; values between parenthesis have the same priority. The application has to respect this priority assignment while adjusting properties:
Definition: The [Definition: active properties set] is the set of properties whose value the application is allowed to choose at a certain time during the adjustment process; initially, the active properties set contains the values of the first priority group;
The application has to check whether it is possible to adjust the content using the current active properties set (choosing an appropriate value between their .minimum and .maximum, or among the available values)
if there is a way to adjust the content, the output should reflect that particular choice of values without changing the other properties (e.g. using their .optimum values); otherwise, the next priority group should be added to the active properties set.
Points to note:
The described behaviour follows an incremental approach rather than a combinatorial one; in other words, the number of attempts the application could need to perform is linear in the size of the property list, instead of growing exponentially.
The main aim of the prioritized property list is for the user to be sure that some properties will be adjusted (moving away from their optimal value) only “as a last resort”; this confidence allows the users to give many properties a length range value without fearing for the resulting quality of the output.
At any given moment during the adjustment process, the application has complete freedom concerning the use of the available elasticity (coming from the active properties at that moment); in other words, it is not forced by this specification to exhaust the elasticity of a property before using the one of a different property.
Common Usage:
The fo:alternative-copyfit-content formatting obiect is intended to express alternative content for copyfit.
It might be a child of a fo:flow object (when copyfitting content into a region) or fo:block-container or fo:table-cell (when copyfitting content in block-containers or table cells).
Areas:
The fo:alternative-copyfit-conten formatting object does not generate any areas. The fo:alternative-copyfit-content formatting object returns the areas generated and returned by its children.
Contents:
(%block;)*
Example:
<fo:flow flow-name="A"> <fo:alternative-copyfit-content> <fo:block word-spacing.minimum="1pt" word-spacing.maximum="4pt" line-height.minimum="8pt" line-height.maximum="14pt">Crucis rosa ut hoc sien qua non res veni.</fo:block> <fo:block word-spacing.minimum="1pt" word-spacing.maximum="4pt" line-height.minimum="8pt" line-height.maximum="14pt"> Etiam tristique, nulla a pulvinar hendrerit nihil tortor urna auctor etim domine secularia cali sed ut quotie ire in domince hoc fantus quis eius rei rei. </fo:block> </fo:alternative-copyfit-content> <fo:block word-spacing.minimum="1pt" word-spacing.maximum="4pt" line-height.minimum="8pt" line-height.maximum="14pt"> Lorem maecenas blandit ac, neque sed ut pulvinar, lectus sagittis sapien per risus vel. Ligula sapien sed morbi cras tellus commodo. Si qua ex docet dei etris crucis</fo:block> <fo:block word-spacing.minimum="1pt" word-spacing.maximum="4pt" line-height.minimum="8pt" line-height.maximum="14pt"> curabitur magna nis, faucibus sed ornare sed, congue eu dui. Pellentesque habitant morbi tristique senectus et netus et malessecularia uada fames ac turpis egestas. </fo:block> <fo:block word-spacing.minimum="1pt" word-spacing.maximum="4pt" line-height.minimum="8pt" line-height.maximum="14pt"> Nunc sit amet dolor sed sem congue mattis sed ut arcu. Mauris id magna sit amet elit aliquam.</fo:block> <fo:block>Pellentesque habitant morbi tristique senectus et netus et malesuada fames.</fo:block> </fo:flow>
The following properties apply to this formatting object:
Open issue
(to be decided; probably any)
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.1.7
Add support for raised initial capitals and n-line dropped capitals. This includes support for the first n characters.
Large initial capital letters are often used for the first paragraph of a new section or chapter. Many scripts have precise alignment conventions for how the initial letter should be positioned relative to the text in the paragraph.
There are three main types of initial letter.
The first of these is called a [raised initial]; it is set in a larger size then the main text, and space must be left for it in the block direction. No special support is needed for raised initials, as an fo:inline can be used with an increased font-size.
The second sort is a margin initial; it protrudes into the margin in the inline direction, and is often larger than the paragraph text. This is treated as a special case of the third sort of initial capital, because of its vertical alignment requirements.
The third sort of initial letter is often called a drop capital (often abbreviated to "drop cap"). The initial letter is large enough that it extends in the block direction to the Nth following baseline; the drop capital in Figure 21 is sized such that its baseline aligns with the baseline of the fourth line of text in the paragraph, and the top aligns with the cap-height on the first line; this is called a 4-line drop cap.
Note:
The height of the letter D is thus one cap-height plus three line-heights (including vertical spacing); this will not in general be equal to four times the font size, and an implementation may need to use an algorithm such as binary search to discover the correct font size given the number of lines to span.
Note:
If the line spacing varies over the course of the paragraph, the resulting size of an initial cap is implementation dependent: it must either be positioned using the inherited line spacing where the initial occurs, or must correctly take into account the varying line spacing, and align with the appropriate actual line of text.
Several properties are used on an "fo:inline" element as follows:
initial-cap-lines
XSL Definition:
Value: | <number> | <distance> |
---|---|
Initial: | 0 |
Applies to: | fo:inline |
Inherited: | yes |
Percentages: | refer to inherited font size |
Media: | visual |
This property specifies the number of lines spanned by the initial letter.
A value of 1.0 would indicate a regular-sized letter, and a value of 4 would indicate that the first character (or glyph) contained in the "fo:inline" bearing this property must be sized such that its baseline is aligned with the baseline of the 4th line of the containing block, and the cap-height aligned with the cap-height of the first line.
For a vertical script, the corresponding leading and trailing alignments points must be used.
If a distance is given instead of a unitless number, it is to be used instead of computing the distance in terms of line heights; in this case the formatter is not expected to guarantee alignment of the baseline of the initial with that of the nearest text baseline.
Open issue: 7562
An alternative design for initial caps and the initial-cap-lines property would be to say that the value of "auto" for font-size would mean that the font-size was computed from the number of lines.
If the "fo:inline" should happen to format to more than one glyph, the second and subsequent glyphs should be drawn at the same size as the first, even if after line-breaking this results in the first character no longer aligning with the fourth baseline.
If the value is negative, an implementation MAY interpret it as as "dropping" backwards (e.g. upwards for horizontal top-to-bottom scripts).
A non-integral value represents a proportion, so that a value of 3.5 would indicate that the initial should be half-way between the baselines of the third and fourth lines of text.
A value of zero MUST taken to be the same as the default value of 1.0, and is in effect ignored.
If the containing block does not have enough content to span the given number of lines, the initial SHOULD be formatted as if there was enough content, and the size of the initial cap MUST then be included in the block-direction dimension of the block.
If there is not enough room left in the column, page or region, the initial must be taken onto the next page along with the text.
When the "initial-cap-lines" property is set on a formatting object that is not at the start of the block, any preceding text should be pushed out into the margin; this is often used for quote marks.
initial-cap-lines-before
XSL Definition:
Value: | <number> | <distance> |
---|---|
Initial: | 0pt |
Applies to: | fo:inline |
Inherited: | yes |
Percentages: | Not applicable. |
Media: | visual |
Sometimes an initial capital extends before the start of the text as well as perhaps continuing for several lines.
The "initial-cap-lines-before" property indicates that the initial is to be formatted at a size such that it protrudes in the block-direction to the given distance or number of lines.
Figure 22 shows a Greek initial capital that protrudes above the first line (as measured from the cap height of the first line of text) as well as extending below it.
A value of zero indicates that the leading edge of the initial is to align exactly with that of capital letters in the regular text size.
If the value is negative, an implementation MAY interpret it as as "dropping" forwards.
Figure 22. Sample Greek Paragraph Starting With Two-Line Initial Capital Protruding Before and After.
Open issue: 7563
Need a clear description of margins, spacing, and initial caps
initial-cap-kern-lines
XSL Definition:
Value: | <length> | <integer> |
---|---|
Initial: | 0 |
Applies to: | fo:inline |
Inherited: | yes |
Percentages: | refer to initial-cap-lines-after |
Media: | visual |
The "initial-cap-kern-lines" property indicates the number of lines of text that should be abutted to the large inital.
A value of 1 would indicate that the first line of text should be set as close as possible, taking into account the shape of the enlarged glyph.
If a distance is given, such as 3cm, any lines whose baselines fall within that distance of the starting reference point of the initial cap are abutted.
The value must not be negative. The default value of zero indicates that no lines are to be kerned closer, and hence all lines are set using the margin.
Note:
In Figure 21, the first line is set close, and subsequent lines are set vertically using the "margin" trait of the "fo:inline" element where it is next to the text.
initial-cap-indent
XSL Definition:
Value: | <length> | <percentage> | auto | inherit |
---|---|
Initial: | 0pt |
Applies to: | fo:inline |
Inherited: | yes |
Percentages: | refer to width of enlarged glyph |
Media: | visual |
The exact font size of the initial is in general computed by the formatter, so the exact distance for an indent must also be computed.
The initial-cap-indent property distance (either as an absolute value or as a percentage of the actual formatted initial cap width) by which the initial is indented in the inline direction.
The "initial-cap-indent" is most often either zero or negative, moving the initial into the margin; a value of -50% leaves the glyph centered on the edge of the containing content area. A value of 20% indents the initial (and hence the first n lines of text) by one fifth (20%) of the width of that glyph.
The enlarged initial is moved in the inline-direction by the given amount.
The enlarged initial is moved in the inline-direction by the given percentage of the size of the glyph.
The indent is computed based on any text that precedes the "fo:inline" container in the same block; if the initial is not at the start of a line, the default behaviour (with a "initial-cap-indent" of zero, the default value) is to put such text in the margin: this is most often an opening quote or other punctuation. With a value of auto, the initial is placed wherever it occurs, and the resulting trait value is computed by the formatter.
Note:
Note: this section needs to be revised in the light of the new general fo:region
The region-body has two extension-regions, called extension-region-start and extension-region-end, which implicitly specify corresponding reference-areas called "start-marginalia-reference-area" and "end-marginalia-reference-area".
The extent in the inline-direction of each extension-region is indicated in the "extent" attribute of the "fo:extension-region-*" declaration, while the block-dimension of the area is the same of the region-body.
Figure 23 shows the current XSL-FO 1.1 page model extended to also include these regions.
An example declaration of these regions is shown below:
<fo:simple-page-master master-name="only" page-height="29.7cm" page-width="21cm" margin-top="1cm" margin-bottom="2cm" margin-left="2.5cm" margin-right="2.5cm"> <fo:region-body margin-top="3cm" margin-bottom="1.5cm" margin-left="2cm" margin-right="2cm"/> <fo:extension-region-start extent="1cm" distance="0.5cm"/> <fo:extension-region-end extent="1cm" distance="0.5cm"/> <fo:region-before precedence="true" extent="3cm"/> <fo:region-after precedence="true" extent="1.5cm"/> <fo:region-start extent="1cm"/> <fo:region-end extent="1cm"/> </fo:simple-page-master>
The element "fo:extension-region-*" also defines other properties of the region such as border, padding, background, etc.
It is an error if a marginalia is contained in a page whose "fo:simple-page-master" does not contain any "fo:extension-region" declaration.
Open issue: 7564
Should users be able to direct marginalia to another region, or only to a predefined marginalia area?
Open issue: 7565
Extension regions may be confusing on a single page master. So far everything is computed relative to the beginning of the page. What about using multiple region bodies of XSL-FO 1.1? That solution would give users more freedom but would require them to impose alignment constraint among regions.
Open issue: 7566
The spec needs to clarify the relation between marginalia and footnotes. In particular, we need to decide whether the marginalia areas can collapse if there's no marginalia. Do we want such a dynamic behavior? There is a note in the requirement document about marginalia and footnotes but it seems to be mainly related to numbering issues.
Common Usage:
Used to define a rectangular region that extends from the region-body along the "start" direction to contain marginalia, if they exist.
Note:
The specification will need to handle non-rectangular regions too here; this is work in progress. [no specific bugillza item for this: it is pervasive]
Areas:
The extension-region-start specifies a viewport/reference pair that is located on the "start" side of the region-body, meaning that the before edge of the extension-region is aligned with the before-edge of the region-body and the end-edge of this region is parallel to the start-edge of the region-body, at a distance specified by the "distance"attribute.
Constraints:
None.
Contents:
Empty.
Common Usage:
Used to define a rectangular region that extends from the region-body along the "end" direction to contain marginalia, if they exist.
The "extension-region-end" region specifies a viewport/reference pair that is located on the "end" side of the region-body. The before-edge of this region is aligned with the before-edge of the region-body and the start-edge of this region is parallel to the end-edge of the region-body, at a distance specified by the "distance" attribute.
Constraints:
None.
Contents:
Empty.
distance
XSL Definition:
Value: | <length> | <percentage> |
---|---|
Initial: | 0pt |
Inherited: | no |
Percentages: | refer to the corresponding inline-progress-dimension of the page-viewport-area. |
Media: | visual |
Specifies the distance between the edge of the region-body and the edge of the extension region to which it applies.
If it applies to fo:extension-region-end, it indicates the distance between the start-edge of the extension region and the end-edge of the region-body. If it applies to to:extension-region-start it indicates the distance between the end-edge of the extension region and the start-edge of the region-body.
Values have the following meanings:
This is an unsigned length. Negative values are treated as if they were zero.
The value is a percentage of the corresponding inline-dimension of the page-viewport-area.
Common Usage:
The fo:marginalia formatting obiect is intended to be used to produce marginalia, positioned in a separate area external to the start-edge or end-edge of the region-body.
Areas:
The fo:marginalia formatting object does not generate any areas. The fo:marginalia formatting object returns the areas generated and returned by its child fo:inline formatting object. The fo:inline element is optional.
Note:
The fo:inline formatting object is also useful for numbered marginalia, requirement 2.2.3.1.
If the fo:inline is empty, the fo:marginalia object does not generate any area.
Additionally the fo:marginalia formatting object returns the block-areas with area class "xsl-marginalia" generated by its fo:marginalia-body child. The areas with area-class "xsl-marginalia" are placed as children of the marginalia-reference-area in the corresponding extension region.
Constraints:
An fo:marginalia is not permitted to have an fo:marginalia, fo:float, fo:footnote, or fo:marker as a descendant. Additionally, an fo:marginalia is not permitted to have as a descendant an fo:block-container that generates an absolutely positioned area.
The term "marginalia-body-area" is defined to mean the first area generated and returned by the fo:marginalia-body, child of the fo:marginalia.
The term "anchor-area" is defined to mean the line area parent of the area generated by the fo:inline child of the fo:marginalia. If the fo:marginalia does not generate any area, the anchor-area is the previous line area in the pre-order visit of the area tree.
These terms are used to specify how to align a marginalia with the text it refers to, setting the "marginalia-relative-align" property. See details below.
Contents:
(inline?,marginalia-body)
The following properties apply to this formatting object:
marginalia-destination-area: to indicate the marginalia-reference-area where the block-areas generated by the child "fo:marginalia-body" will be placed. This property can be inherited.
Possible values of this attribute are:
"start": the content of the marginalia will be placed in the extension-region-start region
"end": the content of the marginalia will be placed in the extension-region-end region
"inside": the content of the marginalia will be placed in the extension-region-end region of an even page and in the extension-region-start of an odd page region
"outside": the content of the marginalia will be placed in the extension-region-start region of an even page and in the extension-region-end of an odd page
marginalia-relative-align: to indicate the alignment of the marginalia with respect to the text it refers to. This property specifies the alignment, in the block-direction, between two areas.
Possible values of this attribute are:
"before": the before-edge of the marginalia-body-area is placed aligned with the before-edge of the anchor-area.
"baseline": the distance between the baseline of the marginalia-body-area is the same as the distance between the baseline of the anchor-area.
Common Usage:
The fo:marginalia-body is used to generate the marginalia content.
Areas:
The fo:marginalia-body generates and returns one or more block-level areas with area-class "xsl-marginalia". The areas with area-class "xsl-marginalia" are placed as children of the marginalia-reference-area in the corresponding extension region.
Constraints:
The fo:marginalia-body is only permitted as a child of an fo:marginalia.
The position of a marginalia in the page (i.e., the corresponding marginalia-reference-area) is indicated in the "marginalia-destination-area" attribute of the "fo:marginalia formatting object."
Areas with area-class equal to "xsl-marginalia "are defined to be "stackable", indicating that they are supposed to be stacked, in the block-direction within their marginalia-reference-area. In addition a "special stacking rule" has to be applied for placing marginalia in the marginalia-reference-area.
The term "marginalia-body-area" is defined to mean the first area generated and returned by the fo:marginalia-body. The term "anchor-area" is defined to mean the line area parent of the area generated by the fo:inline child of the fo:marginalia. If the fo:marginalia does not generate any area, the anchor-area is the previous line area in the pre-order visit of the area tree.
The offset of the before-edge of the marginalia-body-area from the before-edge of the marginalia-reference-area cannot be smaller than the offset of the before-edge of the anchor-area from the before-edge of the region-reference-area. This constraint makes marginalia anchored to the text they refer to.
The "marginalia-relative-align"property of the fo:marginalia formatting object allows users to further specify the alignment of a marginalia with the text it refers to.
The following properties apply to this formatting object:
Common accessibility properties; id; index-class; index-key.
marginalia-destination-area
XSL Definition:
Value: | start | end | inside | outside | inherit |
---|---|
Initial: | start |
Applies to: | fo:marginalia |
Inherited: | yes |
Percentages: | Not applicable. |
Media: | visual |
Specifies the marginalia-reference-area in which to place the block-areas generated by the child fo:marginalia-body to which it applies.
Values have the following meanings:
The content of the marginalia will be placed in the extension-region-start region.
The content of the marginalia will be placed in the extension-region-end region.
The content of the marginalia will be placed in the extension-region-end region on even pages and in the extension-region-start region on odd pages.
The content of the marginalia will be placed in the extension-region-start region on even pages and in the extension-region-end region on odd pages.
marginalia-relative-align
XSL Definition:
Value: | before | baseline | end | inherit |
---|---|
Initial: | before |
Applies to: | fo:marginalia |
Inherited: | yes |
Percentages: | Not applicable. |
Media: | visual |
Specifies the alignment of the marginalia with respect to the text to which it refers. This property specifies the alignment, in the block-direction, between two areas.
Values have the following meanings:
The before-edge of the marginalia-body-area is aligned with the before-edge of the anchor-area.
The distance between the baseline of the marginalia-body-area is the same as the distance between the baseline of th anchor-area extension-region-start region.
The after-edge of the marginalia-body-area is aligned with the after-edge of the anchor-area.
A general comment: vertical positioning (and justification) is connected to regions and columns, and the interaction between them, and that work is not yet complete. In addition, the term Vertical in this section should be taken to mean block-direction.
Feathering is the process of fitting a block of text to available space, such as the height of the page, for example by adding a small (and ideally imperceptible) amount of space between each line of text. The formatter adjusts the space-before and space-after traits of the stacked block-areas and line-areas in order to fill the reference area.
Feathering can be seen as a special case of vertical justification, where the set of adjustable properties is fixed (line-height, space-before and space-after).
Thus, our proposal is to activate feathering by indicating that
vertical justification is done by adjusting those properties.
This can be done by setting the property display-align
to
"justify" and by listing the names "line-height", "space-before",
"space-after" in the "adjustable-properties" property. The
short-hand "feathering" can be used as a value for this property
instead.
Space-specifiers (minimum, optimum and maximum) are used to specify constraints on the amount of space to be added, as explained for vertical justification ([ADD LINK]).
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.4.2
Add support for correlating vertical position so that lines of text on two adjacent pages, columns or regions are visually next to each other. Also support alignment of the two sides of the same sheet, so that the lines of text on the back side and front side of the sheet are aligned. Note that this requirement is different from optical alignment. The problem arises if pages/columns contain objects whose height is different than the normal line-height. Some space must be added before/after those objects in order to adjust the layout.
To address this we introduce a new property that specifies a "normalized line height" that must be used as an atomic unit of height. That property specifies a length that the block -dimension of each generated area must be a multiple of. Spaces are added before/after each generated area in order to adjust the block-dimension. In a multi-column region, the same value is used for all columns.
A provisional name is "block-unit", whose value is a length.
block-unit
XSL Definition:
Value: | <length> |
---|---|
Initial: | 0pt |
Applies to: | fo:region-body, fo:region-before, fo:region-after, fo:region-start, fo:region-end, fo:block-container |
Inherited: | yes |
Percentages: | Not applicable. |
Media: | visual |
When this property is set and non-zero, the block dimension of each generated area must be rounded up to the nearest multiple of the property value.
A value of zero means that there is no such constraint on the area block dimension.
The block dimension of each generated area should be rounded up to the nearest greater value that is an integer multiple of the specified length. The difference between the original block dimension and the rounded one MUST be transformed into a space-before and / or a space-after (according to the area position and the space conditionality).
For example, suppose that a region has block-unit="12pt". Each block <fo:block line-height="10pt" line-stacking-strategy="font-height" >Text ......</fo:block> will have a block dimension equal to N * 12pt (the block dimension of each line area is not changed). So, if the block creates eight line areas, the first two placed at the bottom of a page and the other six at the beginning of the next page, the first block area will be given a block dimension equal to 24pt (with a 4pt space-before) and the second block will have a 60pt block dimension with no extra space.
The property applies to fo:region-* and fo:block-container, and defines how to adjust the block dimension of the first-level block formatting objects (the direct children of either fo:flow or fo:static-content).
The intended consequence is that lines of text on facing pages will line up, and also that show-through of lines printed on the other side of a page will be reduced, because the lines of text are printed in corresponding places on each side of the paper.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.4.3
Add support for vertical alignment, such as centering the content of the columns or aligning to the bottom within pages, regions or columns.
Note:
This section does not yet take new work on columns (elsewhere in this document) into account.
For this, we use the existing "display-align" property:
In a multi-column region the same value is used for all columns, apart from the last one (specified with the property "display-align-last-column").
Applies to: fo:region-body, fo:region-before, fo:region-after, fo:region-start, fo:region-end and fo:block-container.
Note:
Property "display-align" also applies to: fo:external-graphic, fo:instream-foreign-object, fo:inline-container, and fo:table-cell. A similar issue exists for vertical justification.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.4.4
Allow users to do alignment specific to the last column.
display-align-last-column
XSL Definition:
Value: | <auto | before | center | after | inherit |
---|---|
Initial: | auto |
Applies to: | fo:region-body |
Inherited: | no |
Percentages: | Not applicable. |
Media: | visual |
Specifies how to align the last column of a multi-column region. This property specifies the alignment, in the block-direction, of the areas that are the children of a reference-area.
Values for the property have the following meaning:
If the "relative-align" property applies to this formatting object the "relative-align" property is used. If not, this value is treated as if "before" had been specified.
The before-edge of the allocation-rectangle of the first child area is placed coincident with the before-edge of the content-rectangle of the reference-area;
The child areas are placed such that the distance between the before-edge of the allocation-rectangle of the first child area and the before-edge of the content-rectangle of the reference-area is the same as the distance between the after-edge of the allocation-rectangle of the last child area and the after-edge of the content-rectangle of the reference-area;
The after-edge of the allocation-rectangle of the last child area is placed coincident with the after-edge of the content-rectangle of the reference-area.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.4.5
Add support for adjusting properties to do vertical justification within a page, a region or a column, as well as across regions.
We extend the display-align
property
with a new value "justify".
It is also important to allow users to specify which properties should be modified in order to do vertical justification. Feathering is one of the possibilities. Other solutions might include widening or narrowing spaces before and after images and tables, stretching or compressing text, changing word-spacing, adjusting the character-spacing, or other strategies.
Thus, we propose the general approach of adjustable properties
as described under ‘copyfitting’ and introduce a property
adjustable-properties
whose value is
a list of properties that the formatter is allowed to change.
Note:
The display-align property also applies to fo:external-graphic, fo:instream-foreign-object and fo:inline-container.
display-align
XSL Definition:
Value: | auto | before | center | after | inherit | justify |
---|---|
Initial: | auto |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
This property specifies the alignment, in the block-direction, of the areas that are the children of a reference-area.
Values have the following meanings:
If the relative-align
property applies
to this formatting object the "relative-align" property is
used. If not, this value is treated as if "before" had been
specified.
The before-edge of the allocation-rectangle of the first child area is placed coincident with the before-edge of the content-rectangle of the reference-area.
The child areas are placed such that the distance between the before-edge of the allocation-rectangle of the first child area and the before-edge of the content-rectangle of the reference-area is the same as the distance between the after-edge of the allocation-rectangle of the last child area and the after-edge of the content-rectangle of the reference-area.
The after-edge of the allocation-rectangle of the last child area is placed coincident with the after-edge of the content-rectangle of the reference-area.
For each reference area generated by a region, the before-edge of the its content-rectangle is placed coincident with the before-edge of the allocation-rectangle of the first child area, and the after-edge of the its content-rectangle should be placed coincident with the after-edge of the allocation-rectangle of the last child area. If the application is not able to achieve copyfitting and the accumulated block-dimension of areas is less the the block-dimension of the reference area (which could happen either for lack of elasticity in the content or for partial support by the formatter), the areas are placed as if "auto" had been specified.
Note that for block-containers and table cells, the available space (height and width) must be known in advance in order for the implementation to be able to fit the text into that space.
display-align-last
XSL Definition:
Value: | auto | before | center | after | inherit | justify |
---|---|
Initial: | auto |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
This property specifies in the block-direction, of the areas that are the children of a reference-area. It is used to express the alignment of a region in the last page or in any page ending with a forced break.
Values have the following meanings:
If the relative-align
property applies
to this formatting object the "relative-align" property is
used. If not, this value is treated as if "before" had been
specified.
The before-edge of the allocation-rectangle of the first child area is placed coincident with the before-edge of the content-rectangle of the reference-area.
The child areas are placed such that the distance between the before-edge of the allocation-rectangle of the first child area and the before-edge of the content-rectangle of the reference-area is the same as the distance between the after-edge of the allocation-rectangle of the last child area and the after-edge of the content-rectangle of the reference-area.
The after-edge of the allocation-rectangle of the last child area is placed coincident with the after-edge of the content-rectangle of the reference-area.
For each reference area generated by a region, the before-edge of the its content-rectangle is placed coincident with the before-edge of the allocation-rectangle of the first child area, and the after-edge of the its content-rectangle should be placed coincident with the after-edge of the allocation-rectangle of the last child area. If the application is not able to achieve copyfitting and the accumulated block-dimension of areas is less the the block-dimension of the reference area (which could happen either for lack of elasticity in the content or for partial support by the formatter), the areas are placed as if "auto" had been specified.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.5.1
To improve decimal alignment, extend the character alignment in table cells to permit a specification of the horizontal position of the alignment point within the column.
Text alignment is ordinarily the same for all cells in a column, so the natural choice is to specify the "text-align" property on the fo:table-column and specify 'text-align="from-table-column()"' on all the fo:table-cell objects in that column. To specify a value other than the default for a specific fo:table-cell in the table-column, use that value in the "text-align" property.
The only accepted value for fo:table-column would be "left", "right", and "decimal" (newly added). When the value is "decimal", each cell's text is aligned on the decimal separator as determined by the locale setting, e.g. "." or ",".
In Microsoft Excel or spreadsheet, the alignment of text in a cell is usually done based on the data's type, e.g. alphabetic text is usually aligned to the left, numbers are usually aligned to the right, and Boolean values are usually aligned to the center. Do we also need to extend the "text-align" property to allow automatic alignment? Should decimal alignment could be a special case for number alignment?
Text in the cells with a single table may be numbers and strings with mixed fonts and properties. Do we also need to provide a guide of the fallback mechanism if the alignment point cannot be determined?
Consider a long table that has tens of thousands of rows. Aligning a column with decimal alignment will have huge impact on the performance on the rendering of the table, since the formatter must know the position of the decimal point in the cell in every row of the column before it can start to calculate the appropriate alignment for all the cells.
Also, inspired by the OASIS table model, should we add a new property only available for either table-cell or table-column called "text-align-charoff". This property would be used if and only if "text-align" is given a single-character string as its value. The value for the "text-align-charoff" property would be the same as the OASIS table model, i.e. specifying a percentage of current column width between the start-edge (as determined based on the "writing-mode") and the point at where the character is aligned. For example, the default value "50" would specify that the character is aligned at the center of the column.
<table-cell text-align="'.'">...
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.5.2
Be able to specify different instances of what the table header or footer should be depending on the different boundaries (page, column and region). This also would allow specifying that certain headers must be omitted at certain boundaries.
Similar to fo:page-sequence-master-alternatives and selecting page masters, provide new formatting objects for selecting alternative headers and footers for tables: fo:table-header-alternatives, fo:table-footer-alternatives, fo:conditional-table-header-reference, and fo:conditional-table-footer-reference.
fo:table-header-alternatives is a child object of fo:table-header. It doesn't have any properties.
fo:table-footer-alternatives is a child object of fo:table-footer. It does not have any properties.
fo:conditional-table-header-reference is a child of
fo:table-header-alternatives. It has a header-position
property.
fo:conditional-table-footer-reference is a child of
fo:table-footer-alternatives. It has a footer-position
property.
The valid values for both "header-position" and "footer-position" are "page", "column" and "region". If a fo:conditional-table-header or fo:conditional-footer-reference doesn't have "header/footer-position" property, it's the default reference for the table.
Sample XSL FO snippet:
<fo:table> <fo:table-header> <fo:table-header-alternatives> <fo:conditional-table-header-reference> ... </fo:conditional-table-header-reference> <fo:conditional-table-header-reference header-position="page"> ... </fo:conditional-table-header-reference> <fo:conditional-table-header-reference header-position="column"> ... </fo:conditional-table-header-reference> ... </fo:table-header-alternatives> </fo:table-header> <fo:table-footer> <fo:table-footer-alternatives> </fo:table-footer-alternatives> </fo:table-footer> <fo:table-body> ... </fo:table-body> </fo:table>
It's relatively cumbersome to use different formatting objects that distinguish alternative headers from alternative footers, so a single object could be introduced to represent the concept e.g. a fo:table-layout-alternatives. Its parent object would determine whether this object represents a header or a footer. The reference object would correspondingly be named fo:conditional-table-layout-reference.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.5.3
Allow users to specify that tables can be split horizontally. It should be possible to have a column repeated when the table is split horizontally, by specifying a row header. There should be a way to keep the split parts visually next to each other depending on binding edge.
In case a table is split over multiple pages and both the rows and columns don’t fit a page, allow users to specify which table part comes out in which order (rows first or columns first).
When printing from spreadsheet applications, printing a table that overflows a single page as series of pages, usually with repeated header rows and columns, is common. Within XSL FO, overflow behavior is specified with the "overflow" property, but the XSL 1.1 "overflow" property has similar semantics to CSS and does not sufficiently handle overflow on tables.
XSL Definition:
Value: | paginate-column-first | paginate-row-first | auto |
---|---|
Initial: | auto |
Applies to: | fo:table |
Inherited: | no |
Percentages: | Not applicable. |
Media: | paged |
Values have the following meanings:
Paginate columns before rows
Paginate rows before columns.
This is the default behavior. The User Agent determines the pagination method.
The "table-overflow" property specifies the method for paginating a large table into multiple pages.
Open issue: 8860
Should other values of "overflow" property be allowed for the "table-overflow" property, e.g. "visible", "hidden", "scroll", and "error-if-overflow"?
Note:
Normally, we would expect the row header and the column header to be repeated during the pagination, but do we need to add another property to allow the user to override the default behavior or to suppress the behavior? Maybe table-omit-header-at-break and table-omit-footer-at-break apply to the alternatives and/or conditional references.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.5.4
Allow users to specify that when a spanned cell in a table is split, the entire cell contents should be repeated on each table instance. This applies to splitting as well as spanning in the block-direction as well as the inline-direction.
In paged media, a table cell may be split, either vertically or horizontally or both, because another table cell in the same row or column overflows its available area. Additionally, a table cell that spans multiple rows or columns may be split because the rows or columns that it spans are paginated on separate pages.
Allow the "overflow" property to be applied to fo:table-cell and add the "repeat" value that applies only to fo:table-cell.
When the value is "repeat", the content of the fo:table-cell will be repeated on the next page.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.5.5
Allow the column lines to extend down or right the table to visually indicate that the table continues. When this happens, any vertical border should be extended beyond the bottom border for the last row or right column [on the page].
This applies to pagination of tables split vertically, horizontally or both vertically and horizontally.
XSL 2.0 defines the following properties: "border-break", "border-before-break", "border-after-break", "border-start-break" and "border-end-break". Their allowed values are: "auto", "hidden" and "extend".
When the value is "extend", the respective border is extended till the end of the area.
When the "border-collapse" property is set to be "collapse", which value of the "border-break" value takes higher priority? "extend"?
When the "border-collapse" property is set to be "separate", if one of the adjacent borders set the "border-break" property to be "auto" or "hidden", but the other is set to be "extend", the rendered table border will looks like this:
Open issue: 8861
Do we need to set the "border-break" style at the fo:table-row level and fo:table-column level, or at table-cell level as proposed here?
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.5.6
When one formatting object is immediately preceding another in block-dimension, be able to specify what to do with their adjacent borders.
Allow the "border-collapse" property on other formatting objects in addition to fo:table-cell, e.g. fo:block and fo:inline.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.5.7
Allow having different borders when a break occurs so that a formatting object is split, e.g. a cell that splits, have a thinner border for the split.
Define properties "border-break-style", "border-start-break-style", "border-end-break-style", "border-before-break-style", and "border-after-break-style". The properties' values are the same as for the "border-style" property, and the same border conflict resolution rules CSS border conflict resolution rules apply.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.5.8
The current specification of XSL says that number-rows-spanned and number-columns-spanned should be a positive integer. Other specifications, such as HTML 4.01, allow 0 as a value, which means that all rows or columns of the current table section are spanned over. This behavior may be added to XSL 2.0, either by allowing 0 as a value, or some other solution.
Allow "0" as a value for the "number-rows-spanned" and "number-columns-spanned" properties, with the same semantics as for HTML 4.01 as described at http://www.w3.org/TR/html4/struct/tables.html#adef-colspan
Open issue: 8862
It would be better to use "all" as a value, but that is not compatible with HTML. Should we allow either?
XSL-FO 2.0 extends the multi-column facility of XSL-FO 2.1 by adding the ability to have columns of different widths, different colours, etc. and by allowing any fo:block-container to have columns.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.11.1
Add support for column balancing.
Note:
Not yet addressed.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.11.2
Add support for spanning over less than the total number of columns.
Note:
Not yet addressed.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.11.3
Allow the span property to have effect when specified on formatting objects that are not direct children of an fo:flow.
Note:
Not yet addressed.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.11.4
Give control over how the text flows when spanning columns over the entire page.
Note:
Not yet addressed.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.11.5
Allow specifying multiple columns of different widths.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.11.6
Allow specifying multiple columns in all regions and also in block-containers, not just the region-body.
column-count
XSL Definition:
Value: | <number> | auto | inherit |
---|---|
Initial: | 1 |
Inherited: | no |
Percentages: | Not applicable. |
Media: | visual |
Values have the following meanings:
A positive integer greater than zero. It is an error to supply a value that is not a positive integer greater than zero.
The value of the column-count
property is
calculated from fo:column-definition elements appearing in
an fo:column-definitions element, which must be the first element
child of this formatting object. If there is no fo:column-definitions
element, a default value of 1
MUST be used. If the column-count
property is explictly set to a number, that number MUST
be used, even in the presence of an fo:column-definitions element.
However, if fo:column-definitions is present and the column-count
property is set, they must agree with each other about the
number of columns.
The column-count
property specifies
the number of columns in the region, block-container.
A value of 1 indicates that this is not a multi-column region or block-container.
Note:
Static content that repeats on every page can be formatted into multiple columns by nesting a block-container inside fo:static-content elements in a page master.
Common Usage:
The fo:column-definitions element is a wrapper around zero or more fo:column-definition elements.
Areas:
No areas are generated by this element.
Constraints:
The fo:column-definitions element is only permitted as a child of a region of block-container; it must be the first child (disregarding white-space).
Contents
(fo:column-definition | fo:column-gap)+
The following properties apply to this formatting object:
id
Open issue
Should you be able to set default properties for all columns here?
Common Usage:
Use the fo:column-definition element to set properties that will be inherited by content in column areas, and also to define the number of columns in the corresponding region or block-container.
Columns are arranged in inline order, with the column contents stacked in the block direction inside them. The first column is numbered 1, the second 2, and so on. Properties set on fo:column-definition elements apply to respective columns: properties from the first fo:column-definition element are applied to the first column, properties from the second fo:column-definition element are applied to the second column, and so on.
If a column-number
property is set on an
fo:column-definition element, it refers to that column.
Areas:
No areas are generated directly by this element.
Constraints:
The fo:column-definition element is only permitted as a child of a fo:column-definitions element.
If a fo:column-definitions element is used, it MUST contain exactly one fo:column-definition element for each column.
Contents
EMPTY
The following properties apply to this formatting object:
id
; any style property.
column-number
Implementations that support multiple columns
MUST support properties that do not
depend on the result of formatting, such as
background-color
,
and
SHOULD support properties such as
color
which do not affect
formatting or copy-fitting.
Implementations MAY also support properties that affect copy-fitting and formatting on a per-column basis, such as having column widths that vary, or setting one or more columns in a different font or size.
Properties explicitly set on formatting objects in the flow override values set on fo:column-definition elements.
Common Usage:
The fo:column-gap element represents the space between columns, or before the first column, or after the last column. It can be given a width, a background-color, and may also contain formatting objects to be rendered in the space between columns on each place. Use fo:column-gap if you want to have different gaps between columns, or if you want some columns to have a rule drawn between them and not others, or to specify the style or extent of the rule, or to contain static content.
If there is no fo:column-gap element between two columns,
the value of the column-gap
property is
used to separate them.
Areas:
No areas are generated directly by this element; areas are generated when the column gap is actually rendered.
Constraints:
The fo:column-gap element is only permitted as a child of a fo:column-definitions element.
Contents
fo:block*
The following properties apply to this formatting object:
id
; any style property.
Open issue
column-rule and column-rule-position are not yet included.
Consider a text set in three columns, with the third column being wider, perhaps to give room to illustrations. Figure 25 shows the intended effect.
<fo:block-container> <fo:column-definitions> <fo:column-definition column="1" width="25%" /> <fo:column-definition column="2" width="25%" /> <fo:column-definition column="3" width="50%" /> </fo:column-definitions> <fo:block> The Greek orders, within our recollection, were regarded as things which if used, could not receive any addition or modification. Yet, in the antique, the variety in the small number of examples, as in the Ionic capital, was considerable; [ . . . ] </fo:block> </fo:block-container>
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.12.1
Be able to define layout-master-sets not only at the top of the FO tree, but also interleaving page-sequences, to allow users to define and change masters, such as simple-page-master and page-sequence master, on the fly instead of having to specify all the masters in the beginning of the FO tree. When traversing the FO tree in pre-order traversal, the master must be defined before it may be referenced by a master-reference property.
Note:
This section is currently worded as a set of changes to XSL-FO 1.1
There are two parts to fulfilling this requirement: modifying allowed contents to allow extra "fo:layout-master-set" elements to appear, and adjusting the wording of the spec to say what happens when it occurs.
Allowed contents
For fo:page-sequence-wrapper, allow fo:layout-master-set where you can now have fo:page-sequence or fo:page-sequence-master:
Change the content model from:
(page-sequence|page-sequence-wrapper)*
to:
(layout-master-set,declarations?,bookmark-tree?, (layout-master-set|page-sequence|page-sequence-wrapper)+)
Changes
The following changes to XSL 1.1 are proposed to satisfy this requirement:
Change:
The fo:layout-master-set is a wrapper around all masters used in the document.
To:
The fo:layout-master-set is a wrapper around masters used in the document.
Change:
The children of the fo:root formatting object are a single fo:layout-master-set, an optional fo:declarations, an optional fo:bookmark-tree, and a sequence of one or more fo:page-sequences and/or fo:page-sequence-wrapper elements.
To:
The children of the fo:root formatting object are a fo:layout-master-set, an optional fo:declarations, an optional fo:bookmark-tree, and a sequence of one or more fo:layout-master-set and/or fo:page-sequences and/or fo:page-sequence-wrapper elements.
Change:
The fo:layout-master-set defines the geometry and sequencing of the pages
To:
The fo:layout-master-sets define the geometry and sequencing of the pages
Change:
The children of the fo:layout-master-set are the pagination and layout specifications and flow-map specifications.
To:
The children of the fo:layout-master-sets are the pagination and layout specifications and flow-map specifications.
Change:
This is the top node of the formatting object tree. It holds an fo:layout-master-set formatting object (which holds all masters used in the document), an optional fo:declarations, an optional fo:bookmark-tree, and one or more fo:page-sequence or fo:page-sequence-wrapper objects.
To:
This is the top node of the formatting object tree. It holds an fo:layout-master-set formatting object, an optional fo:declarations, an optional fo:bookmark-tree, and one or more of fo:layout-master-set, fo:page-sequence or fo:page-sequence-wrapper objects. An fo:layout-master-set holds masters used in the document.
Change the contents to:
(layout-master-set,declarations?,bookmark-tree?, (layout-master-set|page-sequence|page-sequence-wrapper)+)
Change:
If the flow-map-reference is specified, the flow-map in effect is the one described by the fo:flow-map child of the fo:layout-master-set having a flow-map-name matching the specified value of flow-map-reference on the fo:page-sequence.
To:
If the flow-map-reference is specified, the flow-map in effect is the one described by the closest preceding fo:flow-map (this is a child of a preceding fo:layout-master-set) having a flow-map-name matching the specified value of flow-map-reference on the fo:page-sequence.
Change:
The fo:layout-master-set is a wrapper around all masters used in the document. This includes page-sequence-masters, page-masters, and flow-maps.
To:
The fo:layout-master-set is a wrapper around masters used in the document. This includes page-sequence-masters, page-masters, and flow-maps.
Change:
Names identify masters, may not be empty and must be unique.
To:
Names identify masters, MUST NOT be empty and must be unique within an fo:layout-master-set.
Change:
A master-name must be unique across all page-masters and page-sequence-masters.
To:
A master-name must be unique across all page-masters and page-sequence-masters within an fo:layout-master-set.
Change:
The names need not be unique, but may not be empty and must refer to a master-name that exists within the document.
To:
The names need not be unique, but MUST NOT be empty and must refer to a master-name that exists within the current or a preceding fo:layout-master-set.
Change:
If the name is empty or if a name-conflict is encountered, an error shall be reported. A processor may then continue processing.
To:
If the name is empty, an error shall be reported. A processor may then continue processing.
If a name-conflict is encountered, the last specified master-name is used.
Some difficulties here: 'flow-name-reference' is a "soft" reference; the flows currently always occur after these references; this current constraint is too loose even for XSL 1.1:
The name identifies a flow; it MUST NOT be empty and must refer to a flow-name that exists within the document.
The definition of fo:flow-map at least includes:
The source list is a sequence of flow names whose corresponding fo:flow objects (in the referring fo:page-sequence) are treated as a single fo:flow for composition purposes.
where "(in the referring fo:page-sequence)" seems a more useful constraint than "within the document".
Change:
The name identifies a region; it may not be empty and must refer to a region-name that exists within the document.
To:
The name identifies a region; it MUST NOT be empty and must refer to a region-name that exists within the current or a preceding fo:layout-master-set.
or it may be best to leave it as-is.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.12.2
Have sets of pages repeatable within the same page-sequence.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.12.3
Allow specifying that every n-th page, a different master should be used. This is a specific case of 2.2.12.2 Repeatable sub-sequence-specifier. For example, use master A for page 1, 2, 3, 4, then master B for page 5, then master A again for 6, 7, 8, 9 then master B for page 10, etc...
To address this requirement, three changes to XSL 1.1 are proposed:
Add 'sequence-repeats' to 'fo:repeatable-page-master-alternatives'
Allow numbers in 'page-position'
Adjust 'fo:repeatable-page-master-alternatives' and 'fo:conditional-page-master-reference' definitions accordingly
sequence-repeats
XSL Definition:
Value: | <number> | no-limit | inherit |
---|---|
Initial: | no-limit |
Inherited: | no |
Percentages: | Not applicable. |
Media: | all |
Specifies the number of pages in a cyclic sub-sequence of pages that may be generated before the cycle repeats.
The values are as follows:
No constraint is specified.
The maximum number of pages in the sub-sequence cycle.
The value is an integer greater than or equal to 0.
If a fractional value or a value less than 0 is specified, it will be rounded to the nearest integer greater than or equal to 0.
A value of 0 indicates this sub-sequence-specifier will not be used.
page-position
XSL Definition:
Value: | <number> | only | first | last | rest | any | inherit |
---|---|
Initial: | any |
Inherited: | no |
Percentages: | Not applicable. |
Media: | all |
This property forms part of a selection rule to determine if the referenced page-master is eligible for selection at this point in the page-sequence or, when the "sequence-repeats" property value is not "no-limit", at this point in the sub-sequence cycle.
The values have the following meanings:
This master is eligible for selection if the value is equal to the current page number or, when the "sequence-repeats" property value is not "no-limit", at this point in the sub-sequence cycle.
Note:
For example: when "sequence-repeats" is 'no-limit', '4' is true for the fourth page in the page-sequence only; when "sequence-repeats" is '4', '4' is true for the fourth, eighth, twelfth, etc. pages in the page-sequence; and when "sequence-repeats" is '6', '4' is true for the fourth, tenth, sixteenth, etc. pages.
The value is an integer greater than or equal to 0.
If a fractional value or a value less than 0 is specified, it will be rounded to the nearest integer greater than or equal to zero.
A value of 0 indicates this master-reference will not be used.
A value greater than the "sequence-repeats" value, when "sequence-repeats" is not 'no-limit', is false.
This master is eligible for selection if this is the only page (i.e. the page is both first and last) page in the page-sequence.
This master is eligible for selection if this is the first page in the page-sequence.
This master is eligible for selection if this is the last page in the page-sequence.
This master is eligible for selection if this is not the first page nor the last page in the page-sequence.
This master is eligible for selection regardless of page positioning within the page-sequence.
Note:
Several of these values can be true simultaneously; for example, 'any' is always true, 'only' is true when both 'first' and 'last' are true, and 'first' and '1' are both true for the first page in a page-sequence. For that reason, it is necessary to order the fo:conditional-page-master-references so that the least inclusive test is performed before the more inclusive test which are also true.
Common Usage:
The fo:repeatable-page-master-alternatives formatting object is the most complex sub-sequence-specifier. It specifies a sub-sequence consisting of repeated instances of a set of alternative page-masters. The number of repetitions may be bounded or potentially unbounded. The repetitions may also be cyclic. Which of the alternative page-masters is used at any point in the sequence depends on the evaluation of a condition on the use of the alternative.
Typical conditions include testing whether the page which is generated using the alternative is:
The first or last page in a page-sequence;
Blank;
The nth page in a page-sequence or a page cycle
The full set of conditions allows different page-masters to be used for the first page, for odd and even pages, for blank pages, etc.
Note:
Because the conditions are tested in order from the beginning of the sequence of children, the last alternative in the sequence usually has a condition that is always true and this alternative references the page-master that is used for all pages that do not receive some specialized layout.
Areas:
The fo:repeatable-page-master-alternatives formatting object generates no area directly. This formatting object is used by the fo:page-sequence formatting object to generate pages.
Constraints:
The children of the fo:repeatable-page-master-alternatives are fo:conditional-page-master-references. These children are called alternatives.
The sub-sequence of pages mapped to this sub-sequence-specifier satisfies the constraints of this sub-sequence-specifier if (a) the sub-sequence of pages consists of zero or more pages, (b) each page is generated using the fo:simple-page-master referenced by the one of the alternatives that are the children of the fo:repeatable-page-master-alternatives, (c) the conditions on that alternative are true, (d) that alternative is the first alternative in the sequence of children for which all the conditions are true, and (e) the length of the sub-sequence is less than or equal to the value of maximum-repeats.
Contents:
(conditional-page-master-reference+)
The following properties apply to this formatting object:
maximum-repeats; sequence-repeats
Common Usage:
The fo:conditional-page-master-reference is used to identify a page-master that is to be used when the conditions on its use are satisfied. This allows different page-masters to be used, for example, for even and odd pages, for the first page in a page-sequence, for the third page in a page-sequence cycle, or for blank pages. This usage is typical in chapters of a book or report where the first page has a different layout than the rest of the chapter and the headings and footings on even and odd pages may be different as well. Selecting page-masters based on position within a cycle is typical of bulk-mailed correspondence that is to be folded into envelopes by a folding machine.
Areas:
The fo:conditional-page-master-reference formatting object generates no area directly. It is used by the fo:page-sequence formatting object to generate pages.
Constraints:
The fo:conditional-page-master-reference has a reference to the fo:simple-page-master which has the same master-name as the master-reference trait on the fo:conditional-page-master-reference.
There are three traits, page-position, odd-or-even, and blank-or-not-blank that specify the sub-conditions on the use of the referenced page-master. All three sub-conditions must be true for the condition on the fo:conditional-page-master-reference to be true.
Note:
Since the properties from which these traits are derived are not inherited and the initial value of all the properties makes the corresponding sub-condition true, only the subset of traits that are derived from properties with specified values must have their corresponding sub-condition be true.
The sub-condition corresponding to the page-position trait is true if the page generated using the fo:conditional-page-master-reference has the specified position in the sequence of pages generated by the referencing page-sequence; namely, "first", "last", "only" (both first and last), "rest" (not first nor last) or "any" (all of the previous) or a number equal to the page number (or the number within the page cycle). The referencing page-sequence is the fo:page-sequence that referenced the fo:page-sequence-master from which this fo:conditional-page-master-reference is a descendant.
The sub-condition corresponding to the odd-or-even trait is true if the value of the odd-or-even trait is "any" or if the value matches the parity of the page number of the page generated using the fo:conditional-page-master-reference.
The sub-condition corresponding to the blank-or-not-blank trait is true, if (1) the value of the trait is "not-blank" and the page generated using the fo:conditional-page-master-reference has areas generated by descendants of the fo:flow formatting objects; if (2) the value of the trait is "blank" and the page generated using the fo:conditional-page-master-reference is such that there are no areas from any fo:flow to be put on that page (e.g., (a) to maintain proper page parity due to (i) a break-after or break-before value of "even-page" or "odd-page" or (ii) at the start or end of the page-sequence or (b) because the constraints on the areas generated by descendants of the fo:flow formatting objects would not be satisfied if they were descendant from this page); or if (3) the value of the trait is "any".
Note:
A "blank page" is a page generated under (2) of the sub-condition corresponding to "blank-or-not-blank" above. This has nothing to do with whether the page appears completely blank to the reader.
Contents:
EMPTY
The following properties apply to this formatting object:
master-reference; page-position; odd-or-even; blank-or-not-blank
<fo:page-sequence-master master-name="name"> <fo:repeatable-page-master-alternatives sequence-repeats="4"> <conditional-page-master-reference page-position="1" master-reference="page-1-of-4"/> <conditional-page-master-reference page-position="2" master-reference="page-2-of-4"/> <conditional-page-master-reference page-position="3" master-reference="page-3-of-4"/> <conditional-page-master-reference page-position="4" master-reference="page-4-of-4"/> </fo:repeatable-page-master-alternatives> <fo:page-sequence-master>
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.17
Be able to treat two facing pages (a two page spread) as a single unit. For example to allow images to cross the page boundaries.
Common Usage:
Used to define a two-page spread consisting of an even and odd page facing each other. The fo:spread-page-master refers to fo:simple-page-masters for the geometries of the pages and the definition of the pages' regions. The fo:spread-page-master may define additional regions that may be generated on one of the pages or may span both pages in the spread.
Areas:
The fo:spread-page-master formatting object generates no area directly. It is used in the generation of pages by an fo:page-sequence.
When the fo:spread-page-master is used to generate pages, three viewport/reference pairs are generated, consisting of a spread-viewport-area and a spread-reference-area for the spread plus a page-viewport-area and a page-reference-area for each of the two pages. The page-viewport-areas represents the physical bounds of the output medium. The page-reference-areas represents the portion of the pages on which content is intended to appear; that is, the area inside the page margins.
When the "binding-edge" trait is "top", the two pages are generated such that the after-edge of the even page is adjacent to the before-edge of the odd page.
In addition, when the fo:spread-page-master is used to generate pages, viewport/reference pairs that correspond to the regions that are the children of the fo:spread-page-master are also generated. These regions are placed relative to the page-height and the page-width of the spread-viewport-area.
When a regions that is a child of the fo:spread-page-master has the same "region-name" as a region that is a child of the fo:simple-page-master for the even- or odd-page, only the child of the fo:spread-page-master generates areas.
Regions that are children of the fo:spread-page-master may span the two pages.
Constraints:
When a fo:spread-page-master is used in the generation of a spread, the block-dimension and inline-dimension of the content-rectangle of the spread-viewport-area are determined using the computed values of the "page-height" and "page-width" properties of the page-masters for the two pages and the "binding-edge" property of the fo:root.
If the value of the media-usage trait is bounded-in-one-dimension or unbounded, only the even-page single-page-master-reference is used.
Contents:
(single-page-master-reference, single-page-master-reference, region*)
The following properties apply to this formatting object:
master-name; writing-mode
Pagination FOs introduction, Currently http://www.w3.org/TR/xsl11/#pag-intro.
*-master-reference FOs
Depends on:
binding edge.
Note:
"page-viewport-areas" no longer represent the physical bounds of the output medium.
Open issue: 7569
What should retrieve-index-mark do for index hits on a double-page spread?
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.18
Add support for bleeds. For example, bleeds allow an image to go beyond the page boundaries so that when you print, bind and cut the paper you don’t have any white space showing.
The bleed is expressed at the page level and identifies the amount of content printed outside the page. The design is responsible for creating and placing content that goes into the bleed, for instance a larger background image or an absolutely positioned image. The trim indicates the correct page size after the trimming (cutting) has been applied. It could be the same as the page size but can also be slightly bigger for binding purposes.
Two properties on the fo:simple-page-master control bleed and trim
bleed-box,
trim-box
XSL Definition:
Value: | x1 y2 x2 y2 |
---|---|
Initial: | 0 0 0 0 |
Applies to: | page reference area |
Inherited: | no |
Percentages: | Not applicable. |
Media: | paged |
The bleed-box property defines the size and position of a notional rectangle around the page in which ink might appear: an implementation should not normally render any content outside the bleed box, although it is not an error conition if content is placed there. The primary purpose of the bleed box is so that when a trimming machine cuts the printed page to size, graphics or other content can go all the way to the edge of the page, by virtue of being printed slightly beyond the place where the blade cuts. Hence, the trim box, whose size and position is specified by the trim-box property, is usually inside the bleed-box.
The values are as follows:
A relative offset from the page reference area origin, used to position the origin of the bleed and trim boxes, respectively. The coordinate system is the same as for the page reference area. The numbers are disances, may be negative.
Relative offsets from the corner of the page reference area that is diagonally opposite to its origin; if x1, y1, x2 and y2 are all zero (the default values) the rectangle will thus be the same size as, and in the same position as, the page reference area. The numbers are disances, may be negative.
Open issue
We also need to add these to "fo:page-master" when that is defined. [no bugzilla entry for this item]
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.6
Introduce a way to position objects next to each other. Side-by-side includes complex positioning and breaking rules (in some cases similar to the constraints necessary for marginalia).
The approach taken in this draft is to use the flow map to express that multiple separate flows are to be synchronized in layout. A single flow is designated as primary, and contains synchronization regions mrked up to draw content from the other, secondary flow or flows; this secondary content will be rendered alongside the main flow at the synchronization points.
A more general mechanism that supports parallel content from within the same flow is under preparation.
flow-map-dependency-reference
<fo:flow-map> <fo:flow-assignment> <fo:flow-source-list> <fo:flow-name-specifier flow-name-reference="Arabic-Flow"/> </fo:flow-source-list> <fo:flow-target-list> <fo:region-name-specifier region-name-reference="Region-Middle"/> </fo:flow-target-list> </fo:flow-assignment> <fo:flow-assignment flow-map-dependency-reference=”Arabic-Flow”> <fo:flow-source-list> <fo:flow-name-specifier flow-name-reference="Armenian-Flow"/> </fo:flow-source-list> <fo:flow-target-list> <fo:region-name-specifier region-name-reference="Region-Right"/> </fo:flow-target-list> </fo:flow-assignment> <fo:flow-assignment flow-map-dependency-reference="Arabic-Flow"> <fo:flow-source-list> <fo:flow-name-specifier flow-name-reference="Syriac-Flow"/> </fo:flow-source-list> <fo:flow-target-list> <fo:region-name-specifier region-name-reference="Region-Left"/> </fo:flow-target-list> </fo:flow-assignment> </fo:flow-map>
Example: Modified Flow-Map to support flow types.
flow-map-dependency-reference
XSL Definition:
Value: | <number> | <distance> |
---|---|
Initial: | none |
Inherited: | no |
Applies to: | fo:flow-assignment |
Percentages: | N/A |
Media: | all |
Values have the following meanings:
The name of a flow.
The given name must exist as the flow-name attribute of a flow in the same flow-map; the property indicates that content in the named flow will be extracted and positioned alongside content in the flow being defined.
The name specified in the flow-map-dependency-reference attribute will normally not be referenced in a flow-source-list in the same flow-assignment, but this is not forbidden, and in that case some or all of the flow content will be duplicated.
The
dependency-content-begin
dependency-content-end
properties are used to identify spans
of separate flows that are to be synchronized,
in a manner similar to that used to mark change bars.
These properties can be applied to any objects,
including in particular fo:block and fo:inline;
the indicated spans can start and end in different
elements, and the two end-points of a span do not
both have to be block or inline; the spans are
treated as being asynchronous with respect to the
formatting.
In the example in figure 29, taken from a parallel-text edition of a text for which there are manuscripts in three different languages, corresponding sections from each manuscript are formatted side by side, with the start of each on the same line, even if the section does not start at the beginning of the line.
The following markup might be used:
<fo:flow flow-name=”Arabic-Flow”> … <fo:block dependency-content-begin=”Key_A”> And Nadan went to Haiqâr, and said to him, ‘W’allah, O my uncle! The king verily rejoiceth in thee for having done what he commanded thee. </fo:block> <fo:block> And now he hath sent me to thee that thou mayst dismiss the soldiers to their duties and come thyself to him with thy handsbound behind thee, and thy feet chained, that the ambassadors of Pharaoh may see this, and that the king may be feared by them and by their king’. </fo:block> <fo:block> And Nadan took him and went with him to the king. </fo:block> <fo:block dependency-content-end=”Key_A”> Then answered Haiqâr and said, ‘To hear is to obey.’ </fo:block> … </fo:flow>
Example 4: dependency-content-start and -end properties
dependency-content-start
XSL Definition:
Value: | <name> |
---|---|
Initial: | none |
Inherited: | no |
Applies to: | All fo flow elements |
Percentages: | N/A |
Media: | all |
Values have the following meanings:
An arbitrary identifer used to correlate content placed in separate flows. It allows references to this formatting object by other objects.
For the purpose of parallel formatting in the block direction, the start of the generated area is used as the alignment point. If there is no generated area, the point at which the element with this property occurred within its container is used.
There must be a corresponding
dependency-content-end
later in the same flow (that is, later in XML
document order).
The dependency-content-start
is set on an element to mark the start of a region in one
flow to be synchronized with a similarly-named region in
another flow.
dependency-content-end
Value: | <name> |
---|---|
Initial: | none |
Inherited: | no |
Applies to: | All fo flow elements |
Percentages: | N/A |
Media: | all |
Values have the following meanings:
An arbitrary identifer used to correlate content placed in separate flows. It allows references to this formatting object by other objects.
For the purpose of parallel formatting in the block direction, the end of the generated area is used as the alignment point. If there is no generated area, the point at which the element with this property occurred within its container is used.
The given name must match value of a
dependency-content-start
earlier in the same flow (that is, earlier in XML
document order).
The dependency-content-start
is set on an element to mark the end of a region in one
flow that is to be synchronized with a similarly-named region in
another flow.
Once the synchronized content has been composed in the non-synchronized and synchronized flows; the flow composition in the non-synchronized flow is resumed until new synchronization content is identified.
dependency-content-stacking-strategy
Value: | none | non-dependent | dependent | all |
---|---|
Initial: | none |
Inherited: | no |
Applies to: | All fo flow elements |
Percentages: | N/A |
Media: | all |
The dependency-content-stacking-strategy property controls how content in a flow is treated when it is between to regions that are synchronized.
Values have the following meanings:
None of the content can be stacked.
Only the content that does not generate dependency boundaries can be stacked.
Only the content that generates dependency boundaries can be stacked.
all the content can be stacked.
Synchronization of flows is generally implemented in a formatter by leaving space between blocks, as can be seen in the left and right columns in Figure 29. Widow and Orphan management is a mechanism for specifying how content between synchronized spans should be treated: it can be kept with a block or moved to the start of the next synchronized spam, or the synchronization gap can be suppressed entirely. If the gap is suppressed, the alignmnent of synchronized spans may not be correct, or the formatter may use other copyfitting techniques to achieve alignment.
Figure 33. illustrates the case where widows and orphans are generated.
The following example shows the the
keep-with-dependent-content
property used
together with synchronized flow content:
<fo:block keep-with-dependent-content=”widows” dependent-content-begin=”Key_A”> Text text text … <fo:inline dependent-content-end=”Key_A”> Text text … </fo:inline> Text text text … </fo:block> <fo:block keep-with-dependent-content=”all”> Text text text … <fo:block dependent-content-begin=”Key_B”> Text text … </fo:inline> Text text text … </fo:block>
Using this example as the document structure equivalent for the schematic representation in Figure 33, the result of applying the keeps is illustrated in Figure 34.
keep-with-dependent-content
XSL Definition:
Value: | none | all | widows | orphans |
---|---|
Initial: | none |
Inherited: | yes |
Applies to: | All fo flow elements |
Percentages: | N/A |
Media: | all |
The keep-with-dependent-content
determines how inline content is treated at the boundaries of
synchronized spans of flow.
Values have the following meanings:
No keep is applied, and the non dependent content is forced to be moved outside the dependency boundaries.
Forces all the non dependent content to be included in the dependency boundaries.
Forces all the generated widows to be included in the dependency boundaries.
Forces all the generated orphans to be included in the dependency boundaries.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 2.2.7
Add support for line number, column number and region number. For example number only every fifth line, etc.
Common Usage:
fo:number creates a number sequence to be processed by the XSL-FO processor and generate a list of sequences in varies of area in the XSL-FO area tree.
Contents:
Empty.
The following properties apply to this formatting object:
name = [ string ]
number-area-extend = width
level = "line" | "footnote" | "column" | "none"
reset-level = [ "block" | "block-container" | "column" | "page" ]
initial-value = [ expression ]
interval = [ expression ]
reset-value = [ expression ]
display-when = [ expression ]
display-position = [ "start" | "end" | "before" | "after" ]
number-align = [ "start" | "end" | "center" | "decimal" ]
text-align = [ "start" | "center" | "end" | "justify" | "inside" | "outside" | "left" | "right" | "decimal" | string | inherit ]
text-decoration = [ "none" | "underline" | "no-underline" | "overline" | "no-overline" | "line-through" | "no-line-through" | "blink" | "no-blink" || "inherit" ]
font-family = [ string ]
font-size = [ absolute-size | relative-size | length | percentage | "inherit" ]
font-style = [ "normal" | "italic" | "oblique" | "backslant" | "inherit" ]
font-weight = [ "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | "inherit" ]
color = [ color ]
background-color = [ color ]
format = [ string ]
decimal-format = [ string ]
letter-value = [ "alphabetic" | "traditional" | <implementater extension> ]
ordinal = [ string ]
country = [ "none" | country | "inherit" ]
language = [ "none" | language | "inherit" ]
grouping-separator = [ char ]
grouping-size = [ number ]
name
XSL Definition:
Required: | yes for level=”none”, no for all other levels. |
---|---|
Type: | string |
Default Value: | none |
The name
identifies an fo:number object for use with level="none" or cross-references.
An fo:number without a name cannot be referenced. There’s no imperative state for an fo:number, i.e. it’s not a counter or an variable. Instead, it provides a reference and display properties for a number series.
level
XSL Definition:
Required: | Yes |
---|---|
Type: | Enumeration of string |
Default Value: | none |
Note: | the property indicates the position that the fo:number object applies to in a page-sequence. Single fo:number object doesn’t apply to multiple page-sequence. |
Values: | line | column | footnote |
The level
determines whether an fo:number is to count
lines, columns, footnotes or some other type of object.
Values for the property have the following meaning:
line numbering, the fo:number is set under the fo:page-sequence, indicating that in this page sequence every line is numbered.
column numbering, the fo:number is set under the fo:page-sequence, indicating that in this page sequence every column is numbered.
footnote numbering, the fo:number is set under the fo:page-sequence, indicating that in this page sequence every footnote is numbered.
expression based numbering, when this value is used, the "name" property needs to be set and we use fo:retrieve-number to retrieve the presentation of the number judged by the fo:number’s display properties. And, fo:retrieve-number use "value" property to provide an expression to evaluate a actually number value for this presentation. fo:retrieve-number is a inline object.
If fo:retrieve-number retrieves a fo:number whose level property is not set to be "none", the expression is not ignored.
reset-level
XSL Definition:
Required: | No |
---|---|
Type: | enumeration of string |
Default Value: | none |
Value: | block | block-container | column | page | none |
The reset-level
determines the level that the fo:number’s internal state in FO processor needs to be reset to
its reset-value.
Note:
The reset-value is not necessarily the same as the initial-value.
Values for the property have the following meaning:
reset when a new fo:block starts; this applies to level=”line” only.
reset when a new fo:block-container start; this applies to level="line" only.
Reset when a new column starts; this applies to level=”line”, level=”paragraph”, and level=”footnote”
reset when a new page starts; this applies to level=”line”, level=”paragraph”, level=”column”, and level=”footnote”
not resetting
The default value of reset-level is none, i.e. not resetting.
initial-value
XSL Definition:
Required: | No |
---|---|
Type: | Expression |
Default Value: | 1 |
The initial-value
provides an initial value for a fo:number object.
Notice that it’s an expression, and reference could be across a page sequence boundary.
For example, an fo:number level=”line” object in
the second page sequence can set the initial value to be continued for the last page sequence.
interval
XSL Definition:
Required: | No |
---|---|
Type: | Expression |
Default Value: | 1 |
Note: | this is an increment value for the number. |
The interval
property on an fo:number object determines the amount
by which the number increses (or decreases) on each occurrence
of the measured unit (lines, blocks, columns, and so forth).
reset-value
XSL Definition:
Required: | No |
---|---|
Type: | Expression |
Default Value: | initial-value if its set or 1 otherwise |
The reset-value
property gives the value (an expression) used for an fo:number series
when a it is reset according to its reset-level.
display-when
XSL Definition:
Required: | No |
---|---|
Type: | Expression |
Default: | true() |
The display-when
display property is an expression: each number generated by
the fo:number object is displayed only when the
expression given for this property has a true or non-zero value.
For a level=”line” object, “value() = 1 or (value() mod 5 = 0)” indicates the number will display every 5 lines and always for first line.
The default value of display-if is “true()”, i.e. always shows.
display-position
XSL Definition:
Required: | No |
---|---|
Type: | Enumeration of string |
Default Value: | start |
Note: | this property indicates the position of the number. For example the object start, object end, object top, object bottom, extra |
Value: | before | after | start | end |
Values for the property have the following meaning:
before the body of the content flow
after the body of the content flow
left or right of the content flow according to the writing-direction
right or left of the content flow according to the writing-direction
The display-position
property of an fo:number object determines where the generated
areas will be placed.
number-align
XSL Definition:
Required: | No |
---|---|
Type: | Enumeration of string |
Default Value: | start |
Note: | indicate the alignment of the displayed number. |
Value: | start | center | end | decimal |
Values for the property have the following meaning:
align the number to the start point based on the writing-direction.
align the number to the center of an area large enough to contain the lagest generated number.
align the number to the end point based on the writing-direction.
align the number to the decimal separator, if increment-by value is not an integer, or to end otherwise.
The number-align
property of a fo:number object determines how numbers are aligned with respect to one another.
Note:
This property was called display-align in the internal editor's draft, but that property already exists in XSL-FO 1.x with a slightly different meaning.
number-area-extend
XSL Definition:
Required: | Yes |
---|---|
Type: | Length |
Default Value: | none |
Reference: | [http://www.w3.org/Style/XSL/Group/FO/wiki/index.php?title=Talk:2.2.7_Numbering#Property:_display-position Property:display-position] |
The number-area-extend
property determines the size of the area to be extended towards the "area before",
"area after", "area start" and "area end" to display the number.
text-align
XSL Definition:
Note: | XSL-FO 1.1 Chapter [http://www.w3.org/TR/xsl/#text-align 7.16.9] |
---|
text-decoration
XSL Definition:
Note: | XSL-FO 1.1 Chapter [http://www.w3.org/TR/xsl/#text-decoration 7.17.4] |
---|
font-family
XSL Definition:
Note: | XSL-FO 1.1 Chapter [http://www.w3.org/TR/xsl/#font-family 7.9.2] |
---|
font-style
XSL Definition:
Note: | XSL-FO 1.1 Chapter [http://www.w3.org/TR/xsl/#font-style 7.9.4] |
---|
font-weight
XSL Definition:
Note: | XSL-FO 1.1 Chapter [http://www.w3.org/TR/xsl/#font-weight 7.9.9] |
---|
background-color
XSL Definition:
Note: | XSL-FO 1.1 Chapter [http://www.w3.org/TR/xsl/#background-color 7.8.1] |
---|
format
XSL Definition:
Required: | No |
---|---|
Type: | String |
Default Value: | none |
Note: | indicates the format picture of the number, XSLT 2.0 Chapter [http://www.w3.org/TR/xslt20/#convert 12.3] |
decimal-format
XSL Definition:
Required: | No |
---|---|
Type: | String |
Default Value: | none |
The decimal-format
property indicates the name of the fo:decimal-format element that defines the format of a decimal number:
decimal values in the generated fo:number sequence eill be formatted using the properties from
the named deciaml-format element.
letter-value
XSL Definition:
Required: | No |
---|---|
Type: | Enumeration of string value |
Default Value: | none |
The letter-value
property disambiguates between numbering sequences that use letters,
such as Roman (i, ii, iii) and Alphabetic (i, j, k).
In many languages there are two commonly used numbering sequences that use letters. One numbering sequence assigns numeric values to letters in alphabetic sequence, and the other assigns numeric values to each letter in some other manner traditional in that language. In English, these would correspond to the numbering sequences specified by the format tokens a and i. In some languages, the first member of each sequence is the same, and so the format token alone would be ambiguous. A value of alphabetic specifies the alphabetic sequence; a value of traditional specifies the other sequence. If the letter-value attribute is not specified, then it is implementation-dependent how any ambiguity is resolved.
ordinal
XSL Definition:
Required: | No |
---|---|
Type: | string |
Default Value: | none |
The ordinal
property determined the ordinal format (1st, 2nd, 3rd, etc.)
as described in XSLT 2.0.
The ordinal
property, if given a value, indicates that fo:number should generate
ordinal rather than cardinal numbers (for example,
1st, 2nd, 3rd, 4th and so on, for English) rather than ordinal
numbers (1, 2, 3, 4...).
When ordinal
is used with the format token w,
the corresponding sequence (e.g. in English, first second third fourth ...)
is generated.
In some
languages, ordinal numbers vary depending on the grammatical context:
for example they may have different genders and may decline with the
noun that they qualify. In such cases the value of the ordinal
attribute may be used to indicate the variation of the ordinal number
required. The way in which the variation is indicated will depend on
the conventions of the language. For inflected languages that vary
the ending of the word, the preferred approach is to indicate the
required ending, preceded by a hyphen.
For example, in German, appropriate values are
-e, -er, -es and -en.
It is implementation-defined what combinations of values of the
format token, the language, and the ordinal attribute are supported.
If ordinal numbering is not supported for the combination of the
format token, the language, and the actual value of the ordinal
attribute, the request is ignored and cardinal numbers are generated
instead.
country
XSL Definition:
Required: | No |
---|---|
Type: | ISO 3166 country code in string |
Default Value: | inherited |
Note: | XSL-FO 1.1 Chapter [http://www.w3.org/TR/xsl/#country 7.10.1] |
language
XSL Definition:
Required: | No |
---|---|
Type: | ISO 639 or [http://www.loc.gov/standards/iso639-2/php/code_list.php|ISO 639-2] language code in string |
Default Value: | inherited |
Note: | XSL-FO 1.1 Chapter [http://www.w3.org/TR/xsl/#language 7.10.2] |
grouping-separator
XSL Definition:
Required: | No |
---|---|
Type: | character |
Default Value: | none |
Note: | the grouping separator for the number, same semantics as xsl:number. |
grouping-size
XSL Definition:
Required: | No |
---|---|
Type: | number |
Default Value: | none |
Note: | the grouping size for the number, same semantics as xsl:number. |
Note:
We have received requirement about adding numbering support for paragraphs and other arbitrary elements in the XSL formatting objects, for example fo:inline for Bible verses, fo:instream-foreign-object for figures and illustrations in the book. Here is our current proposal towards the solution that is still under consideration and we'd like to hear public's feedback on the proposal.
The idea is to add attribute "number-ref-id" in any formatting object that needs to count the occurences. For example if we defined two fo:number objects as following:
<!-- the level needs to be set as "none" --> <fo:number name="p1" level="none"/> <fo:number name="f1" level="none"/>
Then we can set every fo:block that marks a new paragraph as this:
<fo:block number-ref-id="p1">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.<fo:block> <fo:block>Ut wisi enim ad minim veniam, quis nostrud exerci tation <fo:instream-foreign-object number-ref-id="f1">...</fo:instreaem-foreign-object> ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</fo:block> <fo:block number-ref-id="p1">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</fo:block> <fo:block>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit</fo:block> <fo:block>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, <fo:instream-foreign-object number-ref-id="f1">...</fo:instreaem-foreign-object> sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</fo:block> <fo:block number-ref-id="p1">Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</fo:block> <fo:block number-ref-id="p1">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</fo:block> <fo:block>In above <fo:retrieve-number name="f1"/> in <fo:retrieve-number name="p1"> paragraphs, we demonstrated the new attribute "number-ref-id"</fo:block>
Notice that, in above example, the attribute "number-ref-id" is added to only four different fo:block object, which means we marked FOUR distinguish paragraphs, instead of SEVEN according to the number of all the fo:block object in total.
The definition of attribute "number-pref-id" is as following:
format
XSL Definition:
Required: | No |
---|---|
Type: | List of String |
Default Value: | none |
Applies To: | fo:block, fo:inline, fo:instream-foreign-object, fo:table-row, and fo:table-cell |
The value indicates the name of an fo:number object that applies to current formatting object.
If a non-leveled fo:number is used, the layout properties for the fo:number will be ignored. I.e. user needs to use fo:retrieve-number to retrieve the current value of fo:number.
fo:retrieve-number retrieves the current value of a fo:number sequence correspondent to the context where the fo:retrieve-number locates. By default the output number format is the format set by the original fo:number properties. Or fo:retrive-number can use its own properties to override the original fo:number's property setting.
<fo:retrieve-number name = string value = [ expression ] format = [ string ] decimal-format = [ QName ] letter-value = [ "alphabetic" | "traditional" | <implementater extension> ] ordinal = [ string ] country = [ "none" | country | "inherit" ] language = [ "none" | language | "inherit" ] grouping-separator = [ char ] grouping-size = [ number ] />
name
XSL Definition:
Required: | Yes |
---|---|
Type: | character |
Default Value: | none |
The name property identifies the name of the fo:number to which the fo:retrieve-number is referring.
value
XSL Definition:
Required: | No |
---|---|
Type: | Expression |
Default Value: | value() |
The value
property is an expression that can be used to generate an actual
displayed value based on the retrieved value.
if (value() - current-page-number() > 1) string(concat('Page ', value()) else if (value() - current-page-number() = 1) 'next page' else if (value() = current-page-number()) 'later this page'
Open issue
Can we generalize the fo:retrieve-number to be fo:retrieve-value or fo:value-of?
fo:decimal-format defines a decimal format that could be used by either fo:number or fo:retrieve-number.
<fo:decimal-format name = [ string ] decimal-separator = [ char ] grouping-separator = [ char ] infinity = [ string ] minus-sign = [ char ] NaN = [ string ] percent = [ char ] per-mille = [ char ] zero-digit = [ char ] digit = [ char ] pattern-separator = [ char ] />
The name
property contains the name of the
fo:decimal-format to be referred by fo:number or fo:retrieve-number.
If this
property is not specified, it defines the default decimal format for the
XSL-FO document in the the scope containing the fo:decimal-format.
The fo:decimal-format property is the same as xsl:decimal-format; please refer to XSLT 2.0 chapter [http://www.w3.org/TR/xslt20/#defining-decimal-format 16.4.1] for detailed syntax and symantics.
Note:
This section will be moving from XSLT 2 to the shared Functions and Operators document for the next revision of XSLT; at that time, this sectin is to be revised accordingly.
<fo:page-sequence master-reference="Letter8"> <fo:number number-area-extend="72pt" level="line" initial-value="1" reset-value="1" display-when="(value()=1) or (value() mod 5 = 0)" number-align="start" text-align="center" text-decoration="none" font-family="Arial" font-style="normal" font-size="12pt" font-weight="normal" color="black" background-color="white" /> <fo:flow flow-name="xsl-region-body"> <fo:block>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.<fo:block> <fo:block>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</fo:block> <fo:block>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</fo:block> <fo:block>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit</fo:block> <fo:block>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</fo:block> <fo:block>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</fo:block> <fo:block>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</fo:block <fo:block>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril.</fo:block> <fo:block>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</fo:block> <fo:block>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</fo:block> <fo:block>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</fo:block> <!-- flow continues --> </fo:flow> </fo:page-sequence>
Requirement:
See the XSL-FO 2.0 Requirements Document, section 5.1.1
This may include SVG font capabilities, such as referring to an external font pointed to with a URI, or being able to define fonts like SVG fonts.
In preparation. The XSL-FO Subgroup wants to align with CSS, SVG and with the emerging consensus on Web fonts for downloadable font support, and to see what font properties will be available. A future draft of this document is likely to contain a more detailed section here.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 5.2
Allow users to force line justification when the line length is within a certain range. For example, normally the last line of a paragraph would not be justified, but if the last line is longer than a certain threshold, justify it anyway.
last-line-minimum-deficit
XSL Definition:
Value: | <length> | <percentage> | inherit |
---|---|
Initial: | 0pt |
Applies to: | fo:block |
Inherited: | yes |
Percentages: | refer to width of containing block |
Media: | visual |
The last-line-minimum-deficit property specifies a length (x) for the minimum line length deficit for the last line-area of a block-area. More precisely, it specifies a constraint on the last line-area child of the last block-area L generated and returned by the formatting object, such that the inline L is either equal to the available width (w) in the inline-dimension (as the term is used in the "justify" value of "text-align"), or is less than or equal to w minus x.
Values for the property have the following meaning:
The minimum line length deficit is a fixed length.
The minimum line length deficit is a percentage of the containing block width.
The value must not be negative.
hyphenation-permitted-minimum-deficit
XSL Definition:
Value: | <length> | <percentage> | inherit |
---|---|
Initial: | 100% |
Applies to: | all elements |
Inherited: | yes |
Percentages: | refer to width of containing block |
Media: | visual |
This property specifies a length (x) for the hyphenation margin for a block. More precisely, it specifies a limitation on the effect of a "hyphenate" value of "true"; hyphenation may be used in the line-breaking algorithm within a given line-area when otherwise the inline-dimension of the line area would be less than the available width in the inline-dimension by an amount greater than x.
Values have the following meanings:
The permitted minimum deficit is a fixed length.
The permitted minimum deficit is a percentage of the containing block width.
The value must not be negative.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 5.3
Add properties to specify what the alignment should be for the 'last line before a break' and the 'first line after a break'.
text-align-before-break
XSL Definition:
Value: | relative | start | center | end | justify | inside | outside | left | right | inherit |
---|---|
Initial: | relative |
Applies to: | all elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
This property describes how inline content of the last line before a break is aligned.
Values have the same meanings as in the definition of "text-align-last".
text-align-after-break
XSL Definition:
Value: | relative | start | center | end | justify | inside | outside | left | right | inherit |
---|---|
Initial: | relative |
Applies to: | all elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
This property describes how inline content of the first line after a break is aligned. Values have the same meanings as in the definition of "text-align-last".
hanging-punctuation
Requirement:
See the XSL-FO 2.0 Requirements Document, section 5.4
Add support for hanging punctuation, both for western [and] non-western languages.
XSL Definition:
Value: | none | <list of characters> |
---|---|
Initial: | none |
Applies to: | all elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
This property describes which characters are allowed to hang outside the margins.
Note:
This should refer to a "list of characters" datatype, which we have not yet defined.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 5.4
Add support for tabs and tab stops that people are used to from word processors. The main requirement for this seems to be compatibility with other formats, mainly word processor formats.
tab-stops
XSL Definition:
Value: | list of pairs of { left | right | center | decimal } and <length> |
---|---|
Initial: | empty list |
Applies to: | all elements |
Inherited: | yes |
Percentages: | refer to width of nearest ancestor reference-area |
Media: | visual |
This property specifies a sequence of tab stop locations relative to the content-rectangle of the closest ancestor reference-area.
Note:
Need to specify overflow and interaction between wide content and tab stops.
Note:
How to invoke tab stops? fo:inline with start-tab and end-tab properties, or a new empty element marker? or a tab-character property?
Each symbol, length pair in the list has the following meaning:
A left tab stop is set at the given location.
A right tab stop is set at the given location.
A center tab stop is set at the given location.
A decimal tab stop is set at the given location. The character value to be aligned is specified by the tab-alignment-character property.
The lengths must not be negative.
Note:
Decimal/character alignment needs to be the same as proposed for tables.
Note:
At this stage of work, we are using the terms left and right rather than start and end.
word-spacing-critical-length
Requirement:
See the XSL-FO 2.0 Requirements Document, section 5.6.3
Allow users to specify the priority between word and letter spacing.
XSL Definition:
Value: | <length> |
---|---|
Initial: | 0pt |
Applies to: | all elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
This property specifies a length (x) for the word spacing to allow before invoking letterspacing. More precisely, it specifies a limitation on the effect of a "letterspacing" value; letterspacing may be used in the line-breaking algorithm within a given line-area when otherwise the word-spacing value would be greater than x.
Values have the following meanings:
The permitted minimum deficit is a fixed length.
The value must not be negative.
hyphenation-push-syllable-count
Requirement:
See the XSL-FO 2.0 Requirements Document, section 5.7.1
Allow specifying the number of syllables in addition to the number of characters to control hyphenation.
XSL Definition:
Value: | <number> |
---|---|
Initial: | 1 |
Applies to: | all elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
The "hyphenation-push-syllable-count" property specifies the minimum number of syllables permitted in a hyphenated word after the hyphenation character. Formatters must not insert hyphens during line breaking in places that would result in word fragments violating this proerty.
Values have the following meanings:
A positive integer. If a non-positive or non-integer value is provided, the value will be rounded to the nearest integer value greater than or equal to 1.
hyphenation-remain-syllable-count
XSL Definition:
Value: | <number> |
---|---|
Initial: | 1 |
Applies to: | all elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
The hyphenation-remain-syllable-count specifies the minimum number of syllables in a hyphenated word before the hyphenation character. This is the minimum number of syllables in the word left on the line ending with the hyphenation character.
Values have the following meanings:
A positive integer. If a non-positive or non-integer value is provided, the value will be rounded to the nearest integer value greater than or equal to 1.
syllable-widows
Requirement:
See the XSL-FO 2.0 Requirements Document, section 5.7.2
Add syllable level widow and orphan controls
XSL Definition:
Value: | <number> |
---|---|
Initial: | 1 |
Applies to: | all elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
The "syllable-widows" property specifies the minimum number of syllables in the last line-area of a block-area.
Values have the following meanings:
A positive integer. If a non-positive or non-integer value is provided, the value will be rounded to the nearest integer value greater than or equal to 1.
The syllable-widows specifies the minimum number of syllables in the last line-area of the block-area for which it is in effect.
hyphenation-exceptions
Requirement:
See the XSL-FO 2.0 Requirements Document, section 5.7.3
Allow users to specify language-specific hyphenation exceptions.
XSL Definition:
Value: | <uri-specification> | none | inherit |
---|---|
Initial: | none |
Applies to: | all elements |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
This property specifies a set of hyphenation-exception words to be used by the hyphenation algorithm.
Values for this property are as follows:
No exceptions are used.
A URI specification giving a reference to the resource containing the exception words.
Note:
We have not defined a format for this resource.
word-widows
Requirement:
See the XSL-FO 2.0 Requirements Document, section 5.7.5
Add word level widow and orphan control.
XSL Definition:
Value: | <number> |
---|---|
Initial: | 0 |
Applies to: | all elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
The "word-widows" property specifies the minimum number of words or partial words in the last line-area of a block-area.
When a word is hyphenated, the remaining portion, a partial word, brought down onto the next line, is to be considered to be a whole word for the purpose of counting words.
Values have the following meanings:
A positive integer. If a non-positive or non-integer value is provided, the value will be rounded to the nearest integer value greater than or equal to 1.
The permitted minimum deficit is a percentage of the containing block width.
The "word-widows" property specifies the minimum number of words in the last line-area of the block-area for which it is in effect.
min-length-of-last-line
Requirement:
See the XSL-FO 2.0 Requirements Document, section 5.7.6
Be able to specify the minimum length of the last line.
XSL Definition:
Value: | <length> |
---|---|
Initial: | 1 |
Applies to: | all elements |
Inherited: | yes |
Percentages: | refer to width of containing block |
Media: | visual |
The min-length-of-last-line
property
specifies the minimum inline-dimension of the the last
line-area in a block-area.
Values have the following meanings:
Specifies a fixed minimum line length.
The minimum line length is a percentage of the containing block width.
The value must not be negative
Requirement:
See the XSL-FO 2.0 Requirements Document, section 6
Improve support for non-Western languages, such as Mongolian, Indic languages, Thai, Japanese, Chinese, etc. The working group invites language experts to identify language specific features that are currently not yet supported by XSL.
Specifically, the Japanese Layout Taskforce has published a document about requirements for general Japanese layout realized with This draft, then, technologies like CSS, SVG and XSL-FO [Requirements for Japanese Text Layout]. This document is being used as an input to the XSL Working Group as a source of requirements, and is currently being discussed within the Group.
Ruby is a small-sized, supplementary text attached to a character or a group of characters in the main text. This section is generally written for Japanese text, although ruby can also be used with other languages and writing systems.
In Japanese, then, a run of ruby text, usually attached to the right of the characters in vertical writing mode or immediately above them in horizontal writing mode, indicates the reading or the meaning of those characters. The characters in the main text that are annotated by ruby are called "base characters". Kana characters are often used for ruby to indicate how to read kanji characters; this is known as ruby annotation or as "furigana".
see http://www.w3.org/TR/jlreq/#en-subheading2_3_1
Modify Section 4.2.1, Area Types (http://www.w3.org/TR/xsl11/#d0e723) to define annotation-area.
An annotation-area is for ruby and emphasis dots.
Modify Section 4.7.2, Line-building (http://www.w3.org/TR/xsl11/#area-linebuild) to include annotation-areas.
Modify Section 4.7.3, Inline-building (http://www.w3.org/TR/xsl11/#area-inlinebuild) to include annotation-areas.
Common usage:
The fo:ruby formatting object is used to contain a string of text that has ruby annotations.
Areas:
The fo:ruby formatting object generates one or more normal inline-area areas. The fo:ruby returns these areas, together with any page-level-out-of-line areas, and reference-level-out-of-line areas returned by the children of the fo:ruby.
Constraints:
No area may have more than one normal child area returned by the same fo:ruby formatting object.
The children of each normal area returned by an fo:ruby must satisfy the constraints specified in 4.7.3 Inline-building.
In addition the constraints imposed by the traits derived from the properties applicable to this formatting object must be satisfied. The geometric constraints are rigorously defined in 4 Area Model.
Contents:
((fo:ruby-base, (fo:ruby-text | (fo:ruby-parenthesis, fo:ruby-text, fo:ruby-parenthesis)) | (fo:ruby-base-container, fo:ruby-text-container, fo:ruby-text-container?))
In addition this formatting object may have a sequence of zero or more fo:markers as its initial children.
The following properties apply to this formatting object:
7.5 Common Accessibility Properties
7.7 Common Aural Properties
7.8 Common Border, Padding, and Background Properties
7.9 Common Font Properties
7.12 Common Margin Properties-Inline
7.13 Common Relative Position Properties
7.14.1 alignment-adjust
7.14.2 alignment-baseline
7.14.3 baseline-shift
7.15.3 block-dimension
7.18.1 color
7.14.5 dominant-baseline
7.15.6 height
7.30.8 id
7.24.1 index-class
7.24.2 index-key
7.15.7 inline-dimension
7.20.3 keep-together
7.20.4 keep-with-next
7.20.5 keep-with-previous
7.16.4 line-height
7.17.4 text-decoration
7.30.17 visibility
7.15.14 width
7.16.13 wrap-option
ruby-align
ruby-overhang
ruby-position
ruby-proportion
ruby-mode
Common Usage:
The fo:ruby-base formatting object is used to contain a string of text that has ruby annotations.
Areas:
The fo:ruby-base formatting object generates and returns one or more normal inline-areas.
Constraints:
No area may have more than one normal child area returned by the same fo:ruby-base formatting object.
The children of the normal area returned by an fo:ruby-base must satisfy the constraints specified in 4.7.3 Inline-building.
Contents:
(#PCDATA|%inline;)*
The following properties apply to this formatting object:
7.7 Common Aural Properties 7.9 Common Font Properties 7.13 Common Relative Position Properties 7.18.1 color 7.30.8 id 7.24.1 index-class 7.24.2 index-key 7.17.2 letter-spacing 7.16.4 line-height 7.30.15 score-spaces 7.17.8 word-spacing
Common Usage:
The fo:ruby-text formatting object is used to contain a string of text that is a ruby annotation.
Areas:
The fo:ruby-text formatting object generates one normal annotation-area. The fo:ruby-text returns this area.
Constraints:
No area may have more than one normal child area returned by the same fo:ruby-text formatting object.
The children of each normal area returned by an fo:ruby-text must satisfy the constraints specified in 4.7.3 Inline-building.
In addition the constraints imposed by the traits derived from the properties applicable to this formatting object must be satisfied. The geometric constraints are rigorously defined in 4 Area Model.
Contents:
#PCDATA
The following properties apply to this formatting object:
7.9 Common Font Properties 7.18.1 color 7.17.2 letter-spacing 7.30.15 score-spaces 7.17.4 text-decoration 7.17.5 text-shadow 7.17.6 text-transform 7.17.8 word-spacing ruby-size ruby-proportion
Common Usage:
The fo:ruby-parenthesis formatting object is used to contain a string of text that is used to denote the beginning or end of ruby text when user agents do not have other ways to present ruby text distinctively from the base text. Parentheses (or similar characters) can provide an acceptable fallback. In this situation, ruby text will only degrade to be rendered inline and enclosed in the fallback parentheses. This is the least inappropriate rendering under the condition that only inline rendering is available. The fo:ruby-parenthesis formatting object cannot be used with complex ruby formatting objects.
Areas:
When generating annotation areas for ruby is not possible, the fo:ruby-parenthesis formatting object generates one or more normal inline-areas. The fo:ruby-parenthesis returns these area.
Constraints:
No area may have more than one normal child area returned by the same fo:ruby-parenthesis formatting object.
The children of each normal area returned by an fo:ruby-parenthesis must satisfy the constraints specified in 4.7.3 Inline-building.
In addition the constraints imposed by the traits derived from the properties applicable to this formatting object must be satisfied. The geometric constraints are rigorously defined in 4 Area Model.
Contents:
(#PCDATA)
The following properties apply to this formatting object:
7.9 Common Font Properties 7.18.1 color 7.17.2 letter-spacing 7.30.15 score-spaces 7.17.4 text-decoration 7.17.5 text-shadow 7.17.6 text-transform 7.17.8 word-spacing ruby-size ruby-proportion
Common Usage:
The fo:ruby-base formatting object is used to contain one or more strings of text that have ruby annotations.
Areas:
The fo:ruby-base-container formatting object does not generate any areas. The fo:ruby-base-container formatting object returns the sequence of areas created by concatenating the sequences of areas returned by each of the children of the fo:ruby-base-container.
Constraints:
No area may have more than one normal child area returned by the same fo:ruby-base-container formatting object.
The children of each normal area returned by an fo:ruby must satisfy the constraints specified in 4.7.3 Inline-building.
Contents:
(fo:ruby-base)+
Common Usage:
The fo:ruby-text-container formatting object is used to contain one or more strings of text that are ruby annotations.
Areas:
The fo:ruby-text-container formatting object does not generate any areas. The fo:ruby-text-container formatting object returns the sequence of areas created by concatenating the sequences of areas returned by each of the children of the fo:ruby-text-container.
Constraints:
No area may have more than one normal child area returned by the same fo:ruby-text formatting object.
The children of each normal area returned by an fo:ruby-text must satisfy the constraints specified in 4.7.3 Inline-building.
In addition the constraints imposed by the traits derived from the properties applicable to this formatting object must be satisfied. The geometric constraints are rigorously defined in 4 Area Model.
Contents:
(fo:ruby-text)+
The following properties apply to this formatting object:
7.9 Common Font Properties 7.18.1 color 7.17.2 letter-spacing 7.30.15 score-spaces 7.17.4 text-decoration 7.17.5 text-shadow 7.17.6 text-transform 7.17.8 word-spacing ruby-overhang ruby-position
ruby-position
XSL Definition:
Based on http://www.w3.org/TR/2003/CR-css3-ruby-20030514/#rubypos
Value: | auto | before | bopomofo | inline | inherit |
---|---|
Initial: | auto |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
This property specifies the position of ruby annotations with respect to their corresponding base glyphs.
Values have the following meanings:
Same as before for fo:ruby-text and the first fo:ruby-text-container, and same as after for the second fo:ruby-text-container. This is the initial value.
The ruby text appears before the base. This is the most common setting used in ideographic East Asian writing systems.
When writing-mode is tb-rl, the ruby appears on the right side of the base and is rendered in the same layout mode as the base.
The ruby text appears after the base. This is a relatively rare setting used in ideographic East Asian writing systems, most often found in educational text.
If the base appears in a tb-rl writing-mode, the bottom ruby appears on the left side of the base and is rendered in the same layout mode as the base (i.e. vertical)
The ruby text appears on the right of the base. Unlike 'before' and 'after', this value is not relative to the inline-direction.
This value is provided for the special case of traditional Chinese as used especially in Taiwan: ruby (made of bopomofo glyphs) in that context appears vertically along the right side of the base glyph, whether the layout of the base characters is vertical or horizontal.
Figure 39. "Bopomofo" ruby in traditional Chinese (ruby text shown in blue for clarity) in horizontal layout
Note:
The bopomofo transcription is written in the normal way as part of the ruby text. The user agent is responsible for ensuring the correct relative alignment and positioning of the glyphs, including those corresponding to the tone marks, when displaying. Tone marks are spacing characters that are present at the end of the ruby text for each base character. They are usually displayed in a separate column to the right of the bopomofo characters, and the height of the tone mark depends on the number of characters in the syllable. One tone mark, however, is placed above the bopomofo, not to the right of it.
Note:
To make bopomofo annotations appear before or after the
base text, like annotations for most other East Asian
writing systems, use the "before" and "after"
values of ruby-position
.
Handling of ruby text that is not bopomofo when the value of ruby-position is set to "bopomofo" is not defined by this specification.
Ruby text follows the ruby base with no special styling. The value can be used to disable ruby text positioning.
If the author has used the XHTML rp element [RUBY] they should set the display value for that element to inline, so that the ruby text is distinguishable from the base text. If no rp element has been used, the author can use the content property with the :before and :after pseudo-elements to set off the ruby text.
ruby-alignment
Based on http://www.w3.org/TR/2003/CR-css3-ruby-20030514/#rubyalign
XSL Definition:
Value: | auto | start | center | end | inherit |
---|---|
Initial: | auto |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
This property specifies alignment of a ruby annotation with respect to its base text.
Values have the following meanings:
The user agent determines how the ruby contents are aligned. This is the initial value.
The ruby text content is aligned with the start edge of the base.
The ruby text content is centered within the width of the base. If the length of the base is smaller than the length of the ruby text, then the base is centered within the width of the ruby text.
The ruby text content is aligned with the end edge of the base.
ruby-group-distribution
Based on http://www.w3.org/TR/2003/CR-css3-ruby-20030514/#rubyalign
XSL Definition:
Value: | auto | distribute-letter | distribute-space | inherit |
---|---|
Initial: | auto |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
This property specifies how the space between the ruby characters or the base characters (whichever is shortest) is distributed.
If the width of the ruby text is smaller than that of the base, then the ruby text contents are evenly distributed across the width of the base, with the first and last ruby text glyphs lining up with the corresponding first and last base glyphs. If the width of the ruby text is at least the width of the base, then the letters of the base are evenly distributed across the width of the ruby text.
If the width of the ruby text is smaller than that of the base, then the ruby text contents are evenly distributed across the width of the base, with a certain amount of white space preceding the first and following the last character in the ruby text. That amount of white space is normally equal to half the amount of inter-character space of the ruby text. If the width of the ruby text is at least the width of the base, then the same type of space distribution applies to the base. In other words, if the base is shorter than the ruby text, the base is distribute-space aligned. This type of alignment is sometimes referred to as the "1:2:1" alignment [JIS4051].
Figure 48. Glyph layout in distribute-space aligned ruby when ruby text is shorter than than its base.
ruby-alignment-edge
Based on http://www.w3.org/TR/2003/CR-css3-ruby-20030514/#rubyalign
XSL Definition:
Value: | auto | normal | line-edge | inherit |
---|---|
Initial: | auto |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
This property specifies what the formatter must do when ruby annotations occur at the start of end of lines.
Values have the following meanings:
The user agent determines how the ruby contents are aligned at the edges of lines. This is the initial value.
When the line head starts with ruby annotated text where the ruby text length is longer than that of the base characters, compose the text so that the first ruby character which overhangs the base text is aligned with the line head, and vice versa.
If the ruby text is not adjacent to a line edge, it is aligned as in 'normal'. Where the ruby text length is longer than that of the base characters and it is adjacent to a line edge, then it is still aligned as in 'normal', but the side of the ruby text that touches the end of the line is lined up with the corresponding edge of the base. In the other scenarios, this is just 'normal'.
ruby-align
Based on http://www.w3.org/TR/2003/CR-css3-ruby-20030514/#rubyalign
XSL Definition:
Value: | auto | start | left | center | end | right | distribute-letter | distribute-space | line-edge | inherit |
---|---|
Initial: | 0 |
Applies to: | fo:inline |
Inherited: | yes |
Percentages: | refer to inherited font size |
Media: | visual |
This property is a shorthand for the "ruby-alignment", "ruby-group-distribution", and "ruby-alignment-edge" properties and maps.
Values have the following meanings:
ruby-alignment
= "auto"
ruby-distribution
= "auto"
ruby-alignment-edge
= "auto"
ruby-alignment
= "start"
ruby-distribution
= "auto"
ruby-alignment-edge
= "auto"
ruby-alignment
= "start" or "end" depending on writing mode
ruby-distribution
= "auto"
ruby-alignment-edge
= "auto"
ruby-alignment
= "center"
ruby-distribution
= "auto"
ruby-alignment-edge
= "auto"
ruby-alignment
= "end"
ruby-distribution
= "auto"
ruby-alignment-edge
= "auto"
ruby-alignment
= "end" or "start" depending on writing mode
ruby-distribution
= "auto"
ruby-alignment-edge
= "auto"
ruby-alignment
= "auto"
ruby-distribution
= "distribute-letter"
ruby-alignment-edge
= "auto"
ruby-alignment
= "auto"
ruby-distribution
= "distribute-space"
ruby-alignment-edge
= "auto"
ruby-alignment
= "auto"
ruby-distribution
= "auto"
ruby-alignment-edge
= "line-edge"
ruby-alignment
= "auto"
ruby-distribution
= "auto"
ruby-alignment-edge
= "auto"
ruby-overhang
XSL Definition:
Value: | auto | start | end | none | inherit |
---|---|
Initial: | none |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
This property specifies whether, and on which side, ruby text is allowed to partially overhang any adjacent text in addition to its own base, when the ruby text is wider than the ruby base.
Ruby text is never allowed to overhang glyphs belonging to another ruby base. Also the user agent is free to assume a maximum amount by which ruby text may overhang adjacent text. The user agent MAY use the JIS4051 [JIS4051] recommendation of using one ruby text character length as the maximum overhang length.
Values have the following meanings:
The ruby text can overhang text adjacent to the base on either side. [JIS4051] specifies the categories of characters that ruby text can overhang. The user agent is free to follow the [JIS4051] recommendation or specify its own classes of characters to overhang. This is the initial value.
The ruby text can overhang the text that precedes it. That means, for example, that ruby can overhang text that is to the left of it in horizontal LTR layout, or it can overhang text that is above it in vertical-ideographic layout.
The ruby text can overhang the text that follows it. That means, for example, that ruby can overhang text that is to the right of it in horizontal LTR layout, or it can overhang text that is below it in vertical-ideographic layout.
This is the default behavior.
ruby-overhang-length
XSL Definition:
Value: | <length> | auto |
---|---|
Initial: | 1em |
Inherited: | yes |
Percentages: | Font-size of ruby |
Media: | visual |
This property specifies the maximum distance that ruby may overhang adjacent characters, when it is possible and necessary for the ruby to overhang.
Values have the following meanings:
The user agent determines the maximum overhang.
The maximum distance the ruby may overhang adjacent characters.
ruby-span
XSL Definition:
Value: | <number> | none | inherit |
---|---|
Initial: | none |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
This property controls the spanning behavior of ruby annotation elements.
Values have the following meanings:
The number of ruby base elements to be spanned by the annotation element. If the <number> is ‘0’, it is replaced by ‘1’. The <number> is the computed value.
No spanning. The computed value is ‘1’
ruby-size
XSL Definition:
Value: | <number> | inherit |
---|---|
Initial: | 0.5 |
Inherited: | yes |
Percentages: | font-size of base characters |
Media: | visual |
This property specifies the size of ruby text.
Note:
In Japanese layout, when ruby is attached to twelve point or larger base characters (usually used for headings), the size of the ruby letter is generally smaller than half the size of the base characters.
Values have the following meanings:
The ratio of the size of ruby characters to base characters.
ruby-proportion
XSL Definition:
Value: | normal | narrow | inherit |
---|---|
Initial: | normal |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
This property controls the aspect ratio of ruby text.
Values have the following meanings:
The ruby characters have normal proportions.
The ruby characters are narrower in the inline-direction so that more ruby characters can fit alongside a base character.
ruby-mode
XSL Definition:
Value: | mono | compound | inherit |
---|---|
Initial: | mono |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
This property specifies whether adjacent fo:ruby-text can intrude on each other.
Values have the following meanings:
Ruby characters do not intrude upon each other:
Adjacent fo:ruby-text are treated as being part of one compound word and may intrude upon each other.
yyy
line-stacking-annotation
XSL Definition:
Value: | include-annotation | exclude-annotation | inherit |
---|---|
Initial: | exclude-annotation |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
Values have the following meanings:
The annotation areas are ignored for line stacking.
The annotation areas are considered for line stacking.
This property determines the line stacking method for block elements containing annotation areas such as from ruby or emphasis dots. In all cases the areas returned by fo:ruby-base or fo:annotation-base (tbd) are considered for line stacking.
Open issue: 7570
Should there be a list of image formats that MUST be supported, e.g. PNG?
All XSL-Formatters must support the PNG image format for included input images.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 7.3
Allow rotating images over arbitrary angles.
XSL-FO can already do this for multiples of 90 degrees; other angles are awaiting completion of the shaped areas work in this document, because if you rotate a rectangle by an angle that is not a multiple of 90 degrees, you get a diamond, and this specification does not (yet) handle non-rectangular inline objects.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 7.4
Add support for callouts. Callouts are labels in a picture, overlaying text on top of a graphic (which typically needs to be translatable). Allow users to make live links from the image or map to the text and vice versa.
For callouts, e.g. adding captions to an image, with arrows pointing to the text, one approach that makes sense here is to use SVG, remembering that allowing fo:blocks inside the SVG may fall out of the work with SVG.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 7.5
Add support for access to individual images in multi-page image formats such as TIFF, PDF or SVG 1.2.
This may be a case of wanting a URI fragment identifier for a specific page of a PDF, or layer of TIFF; for SVG this is a liaison item. If a media type doesn't define a fragment type, we could add an extra property.
Open issue: 7571
What if you don't know in advance how many layers there are in advance in, say, a TIFF image, and want to print them all as pages?
Requirement:
See the XSL-FO 2.0 Requirements Document, section 9.6
Improved color support including things that SVG Print does. For example add device-specific CMYK color. Add support for the color names that are supported in SVG. Fills/Shading/Vignettes.
A function is added to support calibrated CMYK colors:
color cmyk-ICC-color(r, g, b, NCName, cyan, magenta, yellow, black)
Two functions are added to support the direct specification of the cartesian and polar forms of the CIE L*ab color space:
color cie-lab-color(r, g, b, Lightness, a-value, b-value) color cie-lchab-color(r, g, b, Lightness, chroma, hue)
A function is introduced to support named-icc-colors (e.g. Pantone™).
color rgb-named-color(r, g, b, NCName, namedColor)
Four new functions are added to support device-dependent (uncalibrated) color (e.g. calibration swatches, registration marks).
color gray-device-color (r,g,b, devGray) color rgb-device-color (r,g,b, devR, devG, devB) color cmyk-device-color (r,g,b, devC, devM, devY, devK)
A conformance class is introduced for implementations which correctly process color managed colors (i.e. do not rely on the fallback colors).
A conformance class is introduced for implementations which correctly process color managed images (i.e. apply, or pass through to a formatter, any embedded ICC profile).
Requirement:
See the XSL-FO 2.0 Requirements Document, section 10
For XSL-FO 2.0 we want to have a close collaboration between the XSL and SVG working groups. Wherever possible we will try to use SVG functionality rather than reinventing our own.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 10.1
Add support for applying a mask (or clip shape) to an object.
Masks in SVG are only applied to viewports. It would be a good practice to do the same and apply it only to block-containers or regions. Masks are declared in the defs space in SVG and then referenced. This enables re-use and complex effects (e.g. Mask with Gradient and so on...)
The approach is to introduce an fo:mask object inside the fo:declarations that contains a valid SVG document providing the mask definition. An XSL-FO renderer can then use an SVG agent to compute the mask and then apply it to the FO rendering result.
<fo:root xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <fo:declarations> <fo:mask mask-name="myFOMask" content-type="image/svg" content-reference-id="svg:mask[@id='svgMask']"> <svg:svg width="8cm" height="3cm" viewBox="0 0 800 300" version="1.1"> <svg:desc>Example mask01 - content masked with gradient against red background</svg:desc> <svg:defs> <svg:linearGradient id="Gradient" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="800" y2="0"> <svg:stop offset="0" stop-color="white" stop-opacity="0" /> <svg:stop offset="1" stop-color="white" stop-opacity="1" /> </svg:linearGradient> <svg:mask id="svgMask" maskUnits="userSpaceOnUse" x="0" y="0" width="800" height="300"> <svg:rect x="0" y="0" width="800" height="300" fill="url(#Gradient)" /> </svg:mask> </svg:defs> ... </svg:svg> </fo:mask> </fo:declarations> ... <fo:block-container mask-reference-name="myFOMask"> ... </fo:block-container> ... </fo:root>
Requirement:
See the XSL-FO 2.0 Requirements Document, section 10.2
Support rotations on any type of object (not just images) over arbitrary angles.
Requirement:
See the XSL-FO 2.0 Requirements Document, section 10.3
Allow applying SVG type transformations to XSL areas.
An SVG-like transform function is introduced for all sort of operations emulating what SVG and PPML do ([SVG], [PPML]) as a property, on "fo:block-container", with the following functions as values:
standard CTM matrix;
move the origin;
resize;
rotate about the origin;
shear by distorting horizontally;
shear by distorting vertically.
The behaviour can be completely inherited from SVG [SVG].
Open issue: 7572
Some Web browsers support transform and translate functions in CSS, but do not account for the resulting shape in page layout! We need to see what the correct CSS behaviour should be, and/or align with one or other spec; [it is most useful for the resulting shape to be able to create intrusions, especially if we use layers and z-axis to manage conflicts, so you can choose whether or not to have an intrusion].
The terms inline-progression-direction, inline-progression-dimension, block-progression-direction and block-progression-dimension have been renamed to inline-direction, inline-dimension, block-direction and block-dimension respectively. The older names are still to be accepted as property values, as aliases, for compatibility.
Since 2010-02-04:
Allow copy-fitting on block-container as well as regions.
Added side-by-side
Added numbering
Added Ruby
Revised copyfitting significantly
Added multiple columns in block-container, and also style properties for individual columns
Change inline-progression-direction to inline-direction
Change block-progression-direction to block-direction
Several new issues linked to bugzilla, and others made into notes.
Various editorial changes
Since 2009-09-29:
Added 2.2.12.2, change master every n pages
Added non-rectangular shapes
Added copyfitting
Added list of properties
Clarified word-widow definition
Several new issues linked to bugzilla, and others made into notes.
Various editorial changes
The following properties are defined in this document, or were defined in XSL-FO 1.1 and are modified here.
The adjustable-properties
property is used to define strategies for copyfitting or vertical justification.
It takes effect only if the property
display-align
is set to "copyfit" or "justify".
The bleed-box property defines the size and position of a notional rectangle around the page in which ink might appear: an implementation should not normally render any content outside the bleed box, although it is not an error conition if content is placed there. The primary purpose of the bleed box is so that when a trimming machine cuts the printed page to size, graphics or other content can go all the way to the edge of the page, by virtue of being printed slightly beyond the place where the blade cuts. Hence, the trim box, whose size and position is specified by the trim-box property, is usually inside the bleed-box.
When this property is set and non-zero, the block dimension of each generated area must be rounded up to the nearest multiple of the property value.
The column-count
property specifies
the number of columns in the region, block-container.
The decimal-format
property indicates the name of the fo:decimal-format element that defines the format of a decimal number:
decimal values in the generated fo:number sequence eill be formatted using the properties from
the named deciaml-format element.
The dependency-content-start
is set on an element to mark the end of a region in one
flow that is to be synchronized with a similarly-named region in
another flow.
The dependency-content-stacking-strategy property controls how content in a flow is treated when it is between to regions that are synchronized.
The dependency-content-start
is set on an element to mark the start of a region in one
flow to be synchronized with a similarly-named region in
another flow.
This property specifies the alignment, in the block-direction, of the areas that are the children of a reference-area.
This property specifies in the block-direction, of the areas that are the children of a reference-area. It is used to express the alignment of a region in the last page or in any page ending with a forced break.
Specifies how to align the last column of a multi-column region. This property specifies the alignment, in the block-direction, of the areas that are the children of a reference-area.
The display-position
property of an fo:number object determines where the generated
areas will be placed.
The display-when
display property is an expression: each number generated by
the fo:number object is displayed only when the
expression given for this property has a true or non-zero value.
Specifies the distance between the edge of the region-body and the edge of the extension region to which it applies.
The given name must exist as the flow-name attribute of a flow in the same flow-map; the property indicates that content in the named flow will be extracted and positioned alongside content in the flow being defined.
The given name must exist as the flow-name attribute of a flow in the same flow-map; the property indicates that content in the named flow will be extracted and positioned alongside content in the flow being defined.
This property describes which characters are allowed to hang outside the margins.
This property specifies a set of hyphenation-exception words to be used by the hyphenation algorithm.
This property specifies a length (x) for the hyphenation margin for a block. More precisely, it specifies a limitation on the effect of a "hyphenate" value of "true"; hyphenation may be used in the line-breaking algorithm within a given line-area when otherwise the inline-dimension of the line area would be less than the available width in the inline-dimension by an amount greater than x.
The "hyphenation-push-syllable-count" property specifies the minimum number of syllables permitted in a hyphenated word after the hyphenation character. Formatters must not insert hyphens during line breaking in places that would result in word fragments violating this proerty.
The hyphenation-remain-syllable-count specifies the minimum number of syllables in a hyphenated word before the hyphenation character. This is the minimum number of syllables in the word left on the line ending with the hyphenation character.
The initial-cap-indent property distance (either as an absolute value or as a percentage of the actual formatted initial cap width) by which the initial is indented in the inline direction.
The "initial-cap-kern-lines" property indicates the number of lines of text that should be abutted to the large inital.
This property specifies the number of lines spanned by the initial letter.
The "initial-cap-lines-before" property indicates that the initial is to be formatted at a size such that it protrudes in the block-direction to the given distance or number of lines.
The initial-value
provides an initial value for a fo:number object.
Notice that it’s an expression, and reference could be across a page sequence boundary.
For example, an fo:number level=”line” object in
the second page sequence can set the initial value to be continued for the last page sequence.
The interval
property on an fo:number object determines the amount
by which the number increses (or decreases) on each occurrence
of the measured unit (lines, blocks, columns, and so forth).
The keep-with-dependent-content
determines how inline content is treated at the boundaries of
synchronized spans of flow.
The last-line-minimum-deficit property specifies a length (x) for the minimum line length deficit for the last line-area of a block-area. More precisely, it specifies a constraint on the last line-area child of the last block-area L generated and returned by the formatting object, such that the inline L is either equal to the available width (w) in the inline-dimension (as the term is used in the "justify" value of "text-align"), or is less than or equal to w minus x.
The letter-value
property disambiguates between numbering sequences that use letters,
such as Roman (i, ii, iii) and Alphabetic (i, j, k).
The level
determines whether an fo:number is to count
lines, columns, footnotes or some other type of object.
This property determines the line stacking method for block elements containing annotation areas such as from ruby or emphasis dots. In all cases the areas returned by fo:ruby-base or fo:annotation-base (tbd) are considered for line stacking.
Specifies the marginalia-reference-area in which to place the block-areas generated by the child fo:marginalia-body to which it applies.
Specifies the alignment of the marginalia with respect to the text to which it refers. This property specifies the alignment, in the block-direction, between two areas.
The min-length-of-last-line
property
specifies the minimum inline-dimension of the the last
line-area in a block-area.
The name
identifies an fo:number object for use with level="none" or cross-references.
The number-align
property of a fo:number object determines how numbers are aligned with respect to one another.
The number-area-extend
property determines the size of the area to be extended towards the "area before",
"area after", "area start" and "area end" to display the number.
The ordinal
property determined the ordinal format (1st, 2nd, 3rd, etc.)
as described in XSLT 2.0.
The ordinal
property, if given a value, indicates that fo:number should generate
ordinal rather than cardinal numbers (for example,
1st, 2nd, 3rd, 4th and so on, for English) rather than ordinal
numbers (1, 2, 3, 4...).
This property forms part of a selection rule to determine if the referenced page-master is eligible for selection at this point in the page-sequence or, when the "sequence-repeats" property value is not "no-limit", at this point in the sub-sequence cycle.
The reset-level
determines the level that the fo:number’s internal state in FO processor needs to be reset to
its reset-value.
The reset-value
property gives the value (an expression) used for an fo:number series
when a it is reset according to its reset-level.
This property is a shorthand for the "ruby-alignment", "ruby-group-distribution", and "ruby-alignment-edge" properties and maps.
This property specifies alignment of a ruby annotation with respect to its base text.
This property specifies what the formatter must do when ruby annotations occur at the start of end of lines.
This property specifies how the space between the ruby characters or the base characters (whichever is shortest) is distributed.
This property specifies whether adjacent fo:ruby-text can intrude on each other.
This property specifies whether, and on which side, ruby text is allowed to partially overhang any adjacent text in addition to its own base, when the ruby text is wider than the ruby base.
This property specifies the maximum distance that ruby may overhang adjacent characters, when it is possible and necessary for the ruby to overhang.
This property specifies the position of ruby annotations with respect to their corresponding base glyphs.
This property controls the aspect ratio of ruby text.
This property specifies the size of ruby text.
This property controls the spanning behavior of ruby annotation elements.
Specifies the number of pages in a cyclic sub-sequence of pages that may be generated before the cycle repeats.
The "syllable-widows" property specifies the minimum number of syllables in the last line-area of a block-area.
This property specifies the character used for alignment for a decimal tab.
This property specifies a sequence of tab stop locations relative to the content-rectangle of the closest ancestor reference-area.
This property describes how inline content of the first line after a break is aligned. Values have the same meanings as in the definition of "text-align-last".
This property describes how inline content of the last line before a break is aligned.
The bleed-box property defines the size and position of a notional rectangle around the page in which ink might appear: an implementation should not normally render any content outside the bleed box, although it is not an error conition if content is placed there. The primary purpose of the bleed box is so that when a trimming machine cuts the printed page to size, graphics or other content can go all the way to the edge of the page, by virtue of being printed slightly beyond the place where the blade cuts. Hence, the trim box, whose size and position is specified by the trim-box property, is usually inside the bleed-box.
The value
property is an expression that can be used to generate an actual
displayed value based on the retrieved value.
This property specifies a length (x) for the word spacing to allow before invoking letterspacing. More precisely, it specifies a limitation on the effect of a "letterspacing" value; letterspacing may be used in the line-breaking algorithm within a given line-area when otherwise the word-spacing value would be greater than x.
The "word-widows" property specifies the minimum number of words or partial words in the last line-area of a block-area.
Use the "wrap" property to specify flow run-around.
When two or more shaped areas interact, the "wrap-path" property determines how text and other inline objects in one area flow around the shape of the other area.
The "wrap-side" property indicates what strategy should be applied for the runaround.
This specification was developed and approved for publication by the W3C XSL Working Group (WG). WG approval of this specification does not necessarily imply that all WG members voted for its approval.
During the development of XSL 2.0 the members of the XSL FO Subgroup were:
Sharon Adler, IBM; Klaas Bals, Inventive Designers; Anders Berglund, IBM; Jeff Caruso, Pageflex; Fabio Giannetti, HP; Tony Graham, Menteith Consulting; Paul Grosso, PTC-Arbortext; Angelo Di Iorio, University of Bologna; Xin (Edward) Jiang, (Oracle, and then Microsoft); Liam Quin, W3C; Zarella Rendon, PTC-Arbortext.
In addition, many members of the public, including users and implementors, have given useful feedback in the form of comments.