axf:baseline-grid

(Auszug aus "XSL-FO ― Die Referenz" von Manuel Montero Pineda & Steffen Herkert, 2016, dpunkt.verlag)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

Category Block Extensions >> Baseline Grid

Sets or clears the baseline grid. V6.3[no-LT]

Value:normal | none | root | new
Initial:normal
Applies to:block-level formatting objects, fo:flow and fo:static-content / block containers
Inherited:no
Percentages:N/A

Values have the following meanings.

normal Neither sets nor clears the baseline grid.
none Clears the baseline grid and the content will not align with a baseline grid.
new Sets a new baseline grid. The new baseline grid is established by using the font and the line-height settings of this element.
root Sets the baseline grid defined by the root element. The root baseline grid is defined by using the font and the line-height settings of the root element.

Inside the area line that a baseline grid is set, the lines are aligned with baselines on the baseline grid. Half-leading is not added before the first line and after the last line so that the em-box edges are aligned with the before and after edges of the content box.

The baseline grid is not available in the area with display-align other than auto.

An HTML+CSS example with baseline grids:

:root { font-size: 10pt; line-height: 18pt; font-family: "Yu Mincho", serif; } @page { size: 128mm 188mm; margin: auto; width: 28rem; height: calc(24rlh - (1rlh - 1rem)); } body { -ah-baseline-grid: root; } h1 { -ah-baseline-grid: new; -ah-baseline-block-snap: center; font-size: 16pt; line-height: 20pt; margin-top: 16pt; margin-bottom: 16pt; } figure { -ah-baseline-grid: none; -ah-baseline-block-snap: auto; }

An XSL-FO example with baseline grids:

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" font-size="10pt" line-height="18pt" font-family="Yu Mincho, serif"> ... <fo:page-sequence master-reference="master"> <fo:flow flow-name="xsl-region-body" axf:baseline-grid="root"> <fo:block axf:baseline-grid="new" axf:baseline-block-snap="center" font-size="16pt" line-height="20pt" space-before="16pt" space-after="16pt"> Heading ... </fo:block> <fo:block>The quick brown fox jumps....</fo:block> ... <fo:block axf:baseline-grid="none" axf:baseline-block-snap="auto"> Figure ... </fo:block> ... </fo:flow> </fo:page-sequence> </fo:root>

This property is not available with AH Formatter V6.3 Lite.

XSL-FO sample:

<fo:root xml:lang="ja" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:cpfo="http://www.compart.net/xmlns/cpfo" xmlns:svg="http://www.w3.org/2000/svg" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">

Antenna House, Inc.

行グリッドの設定例

axf:baseline-grid 指定により、見出しや図があっても各段の行の位置がずれないように行グリッドを設定できます。axf:baseline-grid="new" により新しい行グリッドを設定します。この要素の font と line-height 設定が行グリッドの設定に利用されます。また、root 指定ではルート要素の font と line-height 設定が行グリッドに利用されます。none 指定で行グリッドを解除します。行以外のブロック(見出しや図表)をどのように行グリッドに配置するかは axf:baseline-block-snap で指定します。本サンプルでは既定値 auto border-box(段の先頭では before、最後では after、それ以外では center と同じ)で指定していますが、別々に before、after、center など指定できます。

axf:baseline-grid 指定あり

このブロックは axf:baseline-grid="new" で行グリッドを設定してます。

見出し

いろはにほへとちりぬるをわかよたれそつねならむ

大きい字

うゐのおくやまけふこえて、あさきゆめみしゑひもせす。いろはにほへとちりぬるを、

より大きい文字

わかよたれそつねならむ、うゐのおくやまけふこえて、あさきゆめみしゑひもせす。いろはにほへとちりぬるをわかよたれそ。ゐのおくやまけふこえて、あさきゆめみしゑひもせす。

図 axf:baseline-block-snap="auto border-box"(既定値)

いろはにほへとちりぬるを、わかよたれそつねならむ。うゐのおくやまけふこえて、あさきゆめみしゑひもせす。いろはにほへとちりぬるを。

図 axf:baseline-block-snap="auto border-box"(既定値)

いろはにほへとちりぬるをわかよたれそつねならむ。うゐのおくやまけふこえて、あさきゆめみしゑひもせす。いろはにほへとちりぬるを。

図 axf:baseline-block-snap="auto border-box"(既定値)

axf:baseline-grid 指定なし

このブロックは axf:baseline-grid による行グリッドの指定を行っていません。

見出し

いろはにほへとちりぬるをわかよたれそつねならむ

大きい字

うゐのおくやまけふこえて、あさきゆめみしゑひもせす。いろはにほへとちりぬるを、

より大きい文字

わかよたれそつねならむ、うゐのおくやまけふこえて、あさきゆめみしゑひもせす。いろはにほへとちりぬるをわかよたれそ。ゐのおくやまけふこえて、あさきゆめみしゑひもせす。

いろはにほへとちりぬるを、わかよたれそつねならむ。うゐのおくやまけふこえて、あさきゆめみしゑひもせす。いろはにほへとちりぬるを。

いろはにほへとちりぬるをわかよたれそつねならむ。うゐのおくやまけふこえて、あさきゆめみしゑひもせす。いろはにほへとちりぬるを。

Download der Beispiele

Output:

Tipp der data2type-Redaktion:
Zum Thema XSL-FO bieten wir auch folgende Schulungen zur Vertiefung und professionellen Fortbildung an: