AreaTree

Introduction

The AH Formatter V6.3 AreaTree is created by integrating XSL 1.1 4. Area Model , but it is not intended to completely mimic the samples in Section 4.10 (although they are very similar).

This specification is provided as-is, without any warranty expressed or implied.

The XSL 1.1 Recommendation does not define an XML representation for the AreaTree. The AreaTree XML defined here is an original specification produced by Antenna House for use only with AH Formatter V6.3.

The AreaTree output for "Hello World!" is shown below. As you can see, it contains information about font, color, and paper size (A4).

<?xml version="1.0"?>
<AreaRoot is-first="true" is-last="true" version="602.2"
    xmlns="http://www.antennahouse.com/names/XSL/AreaTree">
    <PageViewportArea output-volume-break="false" is-first="true" is-last="true"
        width="595.276pt" height="841.89pt" abs-page-number="1" page-number="1" format="1">
        <PageReferenceArea is-first="true" is-last="true" width="595.276pt" height="841.89pt"
            display-role="block">
            <RegionViewportArea is-first="true" is-last="true" width="595.276pt"
                height="841.89pt" region-name="xsl-region-body">
                <RegionReferenceArea is-first="true" is-last="true" width="595.276pt"
                    height="841.89pt" display-role="block">
                    <MainReferenceArea is-first="true" is-last="true" width="595.276pt"
                        height="841.89pt">
                        <ColumnReferenceArea is-first="true" is-last="true" width="595.276pt"
                            height="841.89pt">
                            <NormalFlowReferenceArea is-first="true" is-last="true"
                                width="595.276pt" height="841.89pt">
                                <BlockArea is-first="true" is-last="true"
                                    bottom-position="829.89pt" width="595.276pt" height="12pt">
                                    <LineArea is-first="true" is-last="true"
                                        top-position="1pt" bottom-position="830.89pt"
                                        width="595.276pt" height="10pt"
                                        baseline-after="2.16309pt" space-before="1pt"
                                        space-after="1pt">
                                        <TextArea color="#000000" is-first="true"
                                            is-last="true" top-position="1pt"
                                            bottom-position="830.89pt"
                                            right-position="542.483pt" width="52.793pt"
                                            height="10pt" baseline-after="2.16309pt"
                                            script="Latn" font-size="10pt"
                                            font-family="Times New Roman"
                                            text-width="52.793pt" text="Hello World!"
                                            kerning-mode="pair" />
                                    </LineArea>
                                </BlockArea>
                            </NormalFlowReferenceArea>
                        </ColumnReferenceArea>
                    </MainReferenceArea>
                </RegionReferenceArea>
            </RegionViewportArea>
        </PageReferenceArea>
    </PageViewportArea>
</AreaRoot>

Area Model

The XSL area model (Area Model) represents areas as nested rectangular structures. It is impossible to handle documents that are not represented as nested rectangular structures. However, the nested structure is nested in a logical arrangement and the actual rectangles may be rendered as overlapping each other.

☞For more details on Area Model, refer to XSL 1.1 4. Area Model.

Every element, other than the root element, defines an area. Areas are classified into two types: block area and inline area. In the XSL specification, regions are stacked (from top to bottom) in the block-progression-direction. The position of all areas in AreaTree is predetermined so the renderer need not worry about stacking. Although there is no cause for concern whether it is a block-area or an inline-area, the block-progression-direction must be considered. For that reason, it is important to know the exact physical position of the rectangle's sides (edges).

The rectangular area, as shown in the figure, consists of the Content Rectangle, Padding Rectangle, and Border Rectangle.

+----------------------------+
| Border Rectangle           |
| +------------------------+ |
| | Padding Rectangle      | |
| | +--------------------+ | |
| | | Content Rectangle  | | |
| | |                    | | |
| | +--------------------+ | |
| +------------------------+ |
+----------------------------+

This figure shows the general horizontal writing style using the block-progression-direction from top to bottom and the inline-progression-direction from left to right. This writing-mode is abbreviated as lr-tb. lr (left to right) is the inline-progression-direction and tb (top to bottom) is the block-progression-direction. The edges are defined as follows:

It is possible to rotate the areas. Even so, the definition of a logical sides remains the same. However, when the area rotates, the physical position is also rotated relative to the page edges.

If not, before and start would remain as the absolute positions top and left. Instead, these are mapped according to the progression-direction as follows:

topbottomleftright
lr-tbbeforeafterstartend
lr-btafterbeforestartend
rl-tbbeforeafterendstart
rl-btafterbeforeendstart
tb-lrstartendbeforeafter
tb-rlstartendafterbefore
bt-lrendstartbeforeafter
bt-rlendstartafterbefore

This area is called either a viewport-area or a reference-area. The viewport-area indicates the area included in the area to be rendered. The reference-area has its own coordinate system, and the coordinates of its child areas are relative to the reference area. In the XSL specification, a reference-area is always the child of a viewport-area, but it is not necessarily always so in the AreaTree. In the AreaTree XML representation, ViewportArea lines up behind the viewport-area element name and in ReferenceArea, behind the reference-area element name.

Datatypes

<digits> is a string of numbers. It is an integer with no '+' or '-' sign.

<integer> is a (possibly signed) integer.

<number> is a (possibly signed) number. Numeric values may include decimal points. Decimal points are represented by periods, not commas.

<length>, such as 12pt, has a <number> plus a unit. The following units are available:

cmcentimeters
mmmillimeters
in2.54cm
pt1/72in
pc12pt

AH Formatter V6.3 converts all lengths in the AreaTree to pt. The aim by doing so is to get rid of as many errors as possible because of the font size in pt.

<percentage> is the percent value plus '%', for example, 75%. As a <number>, this would be written as 0.75.

<color> has the following formats: Color values are not case-sensitive.

<R>,<G>,<B>0–255
<S>0.0(black)–1.0(white)
<C>,<M>,<Y>,<K>0.0–1.0

Properties

Common properties

These are the properties common to AreaTree elements. Although not all elements necessarily have these properties, many of them do.

Property Value Default Description
is-first true | false false Indicates whether the area is the first or last child of its parent area.
is-last true | false false
writing-mode lr-tb | rl-tb | tb-rl | lr-bt | rl-bt | tb-lr | bt-rl | br-lr lr-tb Text, etc., progression-direction.
width <length> - Size of the content rectangle. width is the length between the start-edge and end-edge; height is the length between the before-edge and after-edge.
height <length> -
top-position <length> - Position of the content rectangle within its reference-area. This is the distance from each side of the reference-area. The following figure shows the positions when the writing mode is lr-tb.
|-->left-position
+-------------------+ --
|                   | ↓
|   +-----------+   | top-position
|   | Content   |   |
|   | Rectangle |   |
|   +-----------+   | bottom-position
|                   | ↑
+-------------------+ --
   right-position<--|
bottom-position <length> -
left-position <length> -
right-position <length> -
space-before <length> 0 The space to be left blank before the area. Many areas do not need to have anything drawn on them. This is because the placement of the area is fixed. Fixed placement of character strings is represented using TextArea.
------------------------
                        <--space-before
+-----------------------
| Border Rectangle
| +---------------------
| | Padding Rectangle
| | +-------------------
| | | Content Rectangle
| | |
space-after <length> 0
space-start <length> 0
space-end <length> 0
padding-before <length> 0 Padding widths.
+-----------------------
| Border Rectangle
| +---------------------
| | Padding Rectangle   <--padding-before
| | +-------------------
| | | Content Rectangle
| | |
padding-before.conditionality discard | retain discard
padding-before.length <length> 0
padding-after <length> 0
padding-start <length> 0
padding-end <length> 0
border-before-width <length> 0 Border widths.
+-----------------------
| Border Rectangle      <--border-before-width
| +---------------------
| | Padding Rectangle
| | +-------------------
| | | Content Rectangle
| | |
border-before-width.length <length> 0
border-before-width.conditionality discard | retain discard
border-after-width <length> 0
border-after-width.length <length> 0
border-after-width.conditionality discard | retain discard
border-start-width <length> 0
border-start-width.length <length> 0
border-start-width.conditionality discard | retain discard
border-end-width <length> 0
border-end-width.length <length> 0
border-end-width.conditionality discard | retain discard
border-double-thickness <length> 0
diagonal-border-width <length> 0
reverse-diagonal-border-width <length> 0
border-before-style <border-style> none Border style. The XSL-FO specification values are based on CSS2 , but AH Formatter V6.3 implements some additional values from CSS3.

none | hidden | dotted | dashed | solid | double | groove | ridge | dot-dash | dot-dot-dash | inset | outset | wave
border-after-style <border-style> none
border-start-style <border-style> none
border-end-style <border-style> none
diagonal-border-style <border-style> none
reverse-diagonal-border-style <border-style> none
border-before-color <color> - Border color.
border-after-color <color> -
border-start-color <color> -
border-end-color <color> -
diagonal-border-color <color> -
reverse-diagonal-border-color <color> -
border-top-left-radius <length> <length>? 0 Radii of the quarter ellipse that defines the shape of the corner. [CSS3-Background] Curve Radii: the ‘border-radius’ properties
border-top-right-radius <length> <length>? 0
border-bottom-left-radius <length> <length>? 0
border-bottom-right-radius <length> <length>? 0
color <color> - Color.
background-color <color> transparent Background color.
font-family <string> - Family name of a font.
font-size <length> - Font size.
font-weight 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 400 Font weight.
font-style normal | italic | oblique | backslant normal Font style.
font-stretch <number> | <percentage> 1.0 Font expansion. (1.0 = 100%)
baseline-after <length> - The portion of the font height that is below the baseline.
baseline-offset <length> - Offset from the baseline in the before direction.
reference-orientation <number> 0 Rotation of the reference area. The value is in degrees. reference-orientation="90" indicates that the area is rotated 90°counterclockwise. AH Formatter V6.3 only allows a 90° right-angle rotation. Rotation at angles other than right angles is defined as follows:
  • The area position is given to the bound rectangle of the content-area. That means, top-position, bottom-position, left-position, right-position determine the position of the bound rectangle.
  • The actual content-area has a specified angle for the bound rectangle.
  • The width and height of the bound rectangle. The same for space-*, padding-*, and border-*-width.
As in the following example, if the content area width is w, the height h, and the rotation angle θ, then the upper left of the figure is the starting point.

 0         X
0+-----+---+
 |   θ/ \  |
 |  /     \|
 |/        +
 +        /|
 |\     /  |
 |  \ /    |
Y+---+-----+

Dimensions of the bounding rectangle:
X = abs(w*cos(θ))+abs(h*sin(θ))
Y = abs(w*sin(θ))+abs(h*cos(θ))
are as above. The starting point moves to the next position.
0–90°start-side(0, w*sin(θ))
90–180°after-side(w*sin(θ-90), Y)
180–270°end-side(X, h*cos(θ-180))
270–0°before-side(h*cos(θ-270), 0)
z-index <integer> - Controls stacking of areas. Larger values are drawn later. Conforms to CSS2 . Once the AreaTree is resolved, the renderer may disregard this property.

Annotation properties

Property Value Default Description
annotation-author <string> - Properties related to Annotation in PDF Output.
annotation-color <color> -
annotation-contents <string> -
annotation-file-attachment <string> -
annotation-font-family <string> -
annotation-font-size <length> -
annotation-font-style <string> -
annotation-font-weight <font-weight> -
annotation-height <string> -
annotation-icon-name <string> -
annotation-open <string> -
annotation-position-horizontal <length> -
annotation-position-vertical <length> -
annotation-text-align <string> -
annotation-text-color <string> -
annotation-title <string> -
annotation-type <string> -
annotation-width <length> -

Elements

AreaRoot

Root element.

Property Value Default Description
bookmark-tree.child <string> - Properties corresponding to XSL 1.1 Formatting Objects for Bookmarks.
bookmark-tree.color <color> -
bookmark-tree.font-weight normal | bold -
bookmark-tree.internal-destination <string> -
bookmark-tree.next <string> -
bookmark-tree.starting-state show | hide show
bookmark-tree.title <string> -
color-profile._CMYK <string> - Color profile to use when "#CMYK", "#GRAYSCALE", or "#RGB" is used with "rgb-icc()". See PDF/X.
color-profile._GRAYSCALE <string> -
color-profile._RGB <string> -
document-info.author <string> - Properties corresponding to axf:document-info "name" values.
document-info.author-title <string> -
document-info.copyright-info-url <anyURI> -
document-info.copyright-notice <string> -
document-info.copyright-status Unknown | Copyrighted | PublicDomain -
document-info.description-writer <string> -
document-info.document-title <string> -
document-info.keywords <string> -
document-info.pagemode UseNone | UseOutline | UseThumbs | FullScreen | UseOC -
document-info.subject <string> -
generator <string> - Application that produced the AreaTree XML.
layer-settings <string> - Corresponds to axf:layer-settings.
output-volume-info.bookmark-include <string> - Properties corresponding to axf:output-volume-info.
output-volume-info.document-info-include <string> -
output-volume-info.format <string> -
output-volume-info.initial-volume-number <string> -
version <string> - Indicates the AreaTree XML version.
xmlns <string> - Always use "http://www.antennahouse.com/names/XSL/AreaTree"
ContentsPageViewportArea+

PageViewportArea

A page within a sequence of pages.

ContentsPageReferenceArea, FixedViewportArea*

PageReferenceArea

RegionViewportArea

In the XSL-FO specification, a page has the following five regions:

          +-------------------+
          |   region-before   |
          +--+-------------+--+
          |  |             |  |
region-start | region-body | region-end
          |  |             |  |
          +--+-------------+--+
          |   region-after    |
          +-------------------+

In AH Formatter V6.3, the RegionViewportArea represents these regions; the region-body is always present, but the other regions might not be present. The XSL-FO specification defines a sequence for the regions, but AH Formatter V6.3 allows them to appear in any order. Consequently, even the order of the RegionViewportArea in AreaTree is not fixed. The AreaTree does not indicate which region produced which RegionViewportArea.

The AreaTree output of AH Formatter V6.3 contains at most five RegionViewportArea. However, it is not a problem if the AreaTree contains more than five RegionViewportArea.

ContentsRegionReferenceArea, SideNoteReferenceArea*

RegionReferenceArea

PageRegionViewportArea

Viewport for a viewport-region pair that is used with area trees from documents styled using CSS.

ContentsPageRegionReferenceArea

PageRegionReferenceArea

Reference area within a PageRegionViewportArea

ContentsBlockArea

MainReferenceArea

ColumnReferenceArea

When there is more than one column, there is one ColumnReferenceArea for column containing content. If the columns are interrupted by spanning areas, the number of ColumnReferenceArea may be greater than the number of columns.

+---------------+---------------+
| Column        | Column        |
| ReferenceArea | ReferenceArea |
+---------------+---------------+
|       SpanReferenceArea       |
+---------------+---------------+
| Column        | Column        |
| ReferenceArea | ReferenceArea |
+---------------+---------------+
Contents(FlowReferenceArea | NormalFlowReferenceArea), AbsoluteFloatArea*, FootnoteReferenceArea?, ColumnruleArea?, RevisionbarArea*

SpanReferenceArea

Represents an area that spans two or more columns in a multi-column layout. Does not exist in single-column layouts.

Contents(NormalFlowReferenceArea | FlowReferenceArea), FootnoteReferenceArea?, ColumnruleArea?, RevisionbarArea*, AbsoluteFloatArea*

FlowReferenceArea

NormalFlowReferenceArea

BlockArea

Block area.

Property Value Default Description
line-continued-mark <string> - Properties related to Line Continued Mark.
line-continued-mark-background-color <string> -
line-continued-mark-color <string> -
line-continued-mark-font-family <string> -
line-continued-mark-font-size <string> -
line-continued-mark-font-style <string> -
line-continued-mark-font-weight <string> -
line-continued-mark-offset <string> -
line-number <string> - Properties related to Line Numbering.
line-number-background-color <string> -
line-number-color <string> -
line-number-font-family <string> -
line-number-font-size <string> -
line-number-font-style <string> -
line-number-font-weight <string> -
line-number-initial <string> -
line-number-interval <string> -
line-number-offset <string> -
line-number-position <string> -
line-number-reset <string> -
line-number-start <string> -
line-number-text-align <string> -
line-number-text-decoration <string> -
Contents(BlockArea | BlockAnchorArea | BlockViewportArea | FormArea | LineArea | TableAndCaptionArea | TableViewportArea | ListBlockArea)*

LineArea

One line of information. Line-break processing occurs before the AreaTree is produced.

Contents(TextArea | LeaderArea | InlineArea | InlineAnchorArea | InlineViewportArea | GraphicViewportArea | BidiOverrideArea | RubyArea | FormFieldArea)*

InlineArea

An area of a line to which different properties are applied.

Contents(TextArea | LeaderArea | InlineArea | InlineAnchorArea | InlineViewportArea | GraphicViewportArea | RubyArea | FormFieldArea)*

TextArea

A sequence of characters that all have the same traits.

Property Value Default Description
text <string> - Original text.
finished-text <string> - A string in the reverse order of the writing direction from the original text. It may contain ligatures and substituted glyphs. If this property is present, its text is rendered instead of the original text.
script <string> - Text script. Values defined by ISO 15924.
text-width <length> - Width of the text.
underline-score true | false false Whether the text has an underscore.
underline-score-color <color> - Color of the underscore.
overline-score true | false false Whether the text has an overscore.
overline-score-color <color> - Color of the overscore.
through-score true | false false Whether the text is scored through.
through-score-color <color> - Color of the through-score.
true | false false Whether the text should blink.
ContentsGlyphArea* | EmphasisArea+

GlyphArea

Lists glyph information for each character in the text. This is used instead of finished-text in the TextArea when rendering. AH Formatter V6.3 does not output glyph information for all text. It is output only for Arabic, Hebrew, and so on. Glyph images are always rendered in the inline-progression-direction. The order remains the same for Arabic, etc. In other words, the glyph information for Arabic is arranged in the reverse order to the Arabic text.

Property Value Default Description
length <number> - Indicates whether this single glyph corresponds to multiple characters in the original text.
glyph <number> - A specified font glyph ID in the TextArea.
glyph-width <number> - Width of the glyph, where 2048 corresponds to the font size.
glyph-pos1 <number> 0 Measure of movement before the glyph image. Units are the same as glyph-width.
glyph-pos2 <number> glyph-width Measure of movement after the glyph image. Units are the same as glyph-width. At Normal position, glyph-pos1=0 and glyph-pos2=glyph-width. When this is a negative number, the characters overlap.
glyph-posy <number> 0 Measure of the glyph vertical movement. +(glyph-posy) moves to a point before the glyph image and -(glyph-posy) moves to a point after the image.
ContentsEMPTY

EmphasisArea

ContentsEMPTY

LeaderArea

Contents are used only when in leader-pattern="use-content" .

Property Value Default Description
leader-pattern space | rule | dots | use-content - Leader pattern.
rule-style none | dotted | dashed | solid | double | dot-dash | dot-dot-dash | wave | double-wave | groove | ridge solid Leader style when leader-pattern="rule".
rule-thickness <length> - Leader thickness when leader-pattern="rule".
Contents(TextArea | LeaderArea | InlineArea | InlineViewportArea | GraphicViewportArea)*

BidiOverrideArea

Contains the result of bidirectional processing. The renderer treats BidiOverrideArea like an InlineArea.

Property Value Default Description
direction ltr | rtl - Writing direction. If finished-text and glyph information are being used, then this property does not affect rendering.
bidi-level <digits> - Bi-directionality level. Please refer to UAX9 for more details. This property does not affect rendering.
Contents(TextArea | LeaderArea | InlineArea | InlineAnchorArea | InlineViewportArea | GraphicViewportArea | BidiOverrideArea)*

BeforeFloatReferenceArea

Reference area for areas floated to the top of the page.

ContentsBeforeFloatArea+

BeforeFloatArea

ContentsBlockArea+

FootnoteReferenceArea

Area for footnotes placed at the bottom of the page. When putting footnotes at the bottom of the page, they may be placed at the end of each column. In the former, theFootnoteReferenceArea is the child of a RegionReferenceArea, and in the latter, it is the child of a ColumnReferenceArea or SpanReferenceArea.

ContentsFootnoteArea*

FootnoteArea

Footnote area.

ContentsBlockArea* | ListBlockArea*

RubyArea

Ruby area.

ContentsRubyContainerArea+

RubyContainerArea

RubyBaseArea

ContentsLineArea

RubyTextArea

ContentsLineArea

FormFieldArea

ContentsEMPTY

FormArea

Form area.

ContentsBlockArea+

BlockAnchorArea

Block containing a footnote anchor. The renderer treats BlockAnchorArea like a BlockArea.

ContentsLineArea*

InlineAnchorArea

Contains footnote anchor text. The renderer treats InlineAnchorArea like an InlineArea.

Contents(TextArea | LeaderArea | InlineArea | InlineViewportArea | GraphicViewportArea)*

GraphicViewportArea

ContentsGraphicArea

GraphicArea

A header indicating the type of the graphic may be included before the Base64-encoded graphic.

graphic-image="data:image/svg+xml;base64,H4sIAAAAAAAAC31S3W7TMBS...
graphic-image="H4sIAAAAAAAAC31S3W7TMBS...

If the header contains the media type, the image type has been predetermined. If it is not included, then the renderer must determine the image type.

Property Value Default Description
src <uri-specification> - The URI of an external image.
base-uri <uri-specification> - Base URI to apply to src.
graphic-image <string> - Image data encoded in Base64. When the same original is included in different areas, the data is repeated each time. After processing SVG in svgz, the data is transformed to Base64.
ContentsEMPTY

TableAndCaptionArea

TableCaptionViewportArea

TableCaptionArea

ContentsBlockArea*

TableViewportArea

ContentsTableArea

TableArea

The W3C table model divides a table into table-header, table-body, and table-footer, but the AreaTree does not preserve the distinction. AH Formatter V6.3 resolves how to divide the table across pages or columns and repeats the table's header as necessary.

ContentsTableColumnGroupArea*, TableColumnArea*, TableRowGroupArea*, TableRowArea+

TableColumnGroupArea

Table column-group area. Holds settings such as background color for groups of columns. AH Formatter V6.3 does not generate this area.

ContentsTableColumnArea+

TableColumnArea

Holds settings such as background color that are used when generating rows.

ContentsEMPTY

TableRowGroupArea

TableRowGroupArea corresponds to table-header, table-body, and table-footer and holds settings such as background color.

ContentsEMPTY

TableRowArea

ContentsTableCellArea+

TableCellArea

ListBlockArea

ContentsListItemArea+

ListItemArea

ListItemLabelArea

ListItemBodyArea

RelativeFloatArea

SideFloatArea

SideNoteReferenceArea

ContentsSideNoteArea+

SideNoteArea

AbsoluteFloatArea

BlockViewportArea

A viewport area that contains a reference area but that is not absolutely position within its containing reference area. However, since its position in AreaTree is fixed, there is no need to differentiate BlockViewportArea and AbsoluteViewportArea from FixedViewportArea.

ContentsFlowReferenceArea | MultiColumnReferenceArea

AbsoluteViewportArea

A viewport area that contains a reference area and that is absolutely positioned within its containing reference area.

ContentsFlowReferenceArea

FixedViewportArea

A viewport area whose fixed position on the page does not depend on the position of any other reference area.

ContentsFlowReferenceArea

InlineViewportArea

A viewport area within an inline area.

ContentsFlowReferenceArea

ColumnruleArea

ContentsEMPTY

RevisionbarArea

ContentsEMPTY

MultiColumnReferenceArea