XML technologies / XSL-FO / Reference / Attributes in XSL-FO / font-stretch

(Excerpt from "XSL-FO ― Die Referenz" by 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

Recommendation section: 7.9.5

Category: 7.9 Common Font Properties

Description

This attribute selects alternative font faces with a particular character width, allowing narrower or wider faces. Relative and absolute keywords are available. Absolute keywords expand or condense the width of normal by fixed factors (steps of 1.2, 1.2², 1.2³, and so on). Relative keywords expand or condense the width used in the surrounding area by a factor of 1.2. Formatters may also support percentage widths.

Values

normal

Absolute width constant. The font’s normal character width is used (100%).

wider

Relative width constant. The character width obtained through inheritance is expanded by a factor of 1.2.

narrower

Relative width constant. The inherited character width is reduced by a factor of 1.2.

semi-expanded

Absolute width constant. The character width is expanded by 120% relative to the normal width of the font.

semi-condensed

Absolute width constant. The character width is reduced by 83% relative to the normal width of the font.

expanded

Absolute width constant. The character width is expanded by 144% relative to the normal width of the font.

condensed

Absolute width constant. The character width is reduced by 69.4% relative to the normal width of the font.

extra-expanded

Absolute width constant. The character width is expanded by 172.8% relative to the normal width of the font.

extra-condensed

Absolute width constant. The character width is reduced by 57.9% relative to the normal width of the font.

ultra-expanded

Absolute width constant. The character width is expanded by 207.4% relative to the normal width of the font.

ultra-condensed

Absolute width constant. The character width is reduced by 48.2% relative to the normal width of the font.

Inherited:

yes

Default value: normal

XSL-FO version: 1.0

Allowed in:

<fo:bidi-override> , <fo:block> , <fo:character> , <fo:initial-property-set> , <fo:inline> , <fo:leader> , <fo:page-number> , <fo:page-number-citation> , <fo:page-number-citation-last> , <fo:scaling-value-citation> and <fo:title>

Support:

Conformance level

Antenna House

FOP

RenderX XEP

Altsoft XML2PDF

Compart DocBridge

Extended

Y

N

Y

Y

Y

XSL-FO example:

<fo:root font-family="Arial" font-size="10pt" line-height="1.2em" 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">
<fo:layout-master-set>
<fo:simple-page-master master-name="Inhalt-Seiten" margin="0mm 0mm 0mm
                      0mm" page-height="297mm" page-width="210mm">
<fo:region-body margin="26mm 25mm 41mm
                        25mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Inhalt-Seiten">
<fo:flow flow-name="xsl-region-body">
<fo:table font-family="Arial" font-size="8pt">
<fo:table-column margin-right="10mm" column-width="50%"/>
<fo:table-column column-width="25%"/>
<fo:table-column column-width="25%"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell padding-right="2mm">
<fo:block space-after="1em" font-stretch="normal">
»was für einen anstrengenden Beruf habe ich gewählt! Tag aus, Tag ein auf der
                Reise.
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="normal">
normal
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="100%">
100%
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding-right="2mm">
<fo:block space-after="1em" font-stretch="semi-condensed">
»was für einen
                anstrengenden Beruf habe ich gewählt! Tag aus, Tag ein auf der Reise.
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="semi-condensed">
semi-condensed
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="83%">
83%
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding-right="2mm">
<fo:block space-after="1em" font-stretch="condensed">
»was für einen anstrengenden Beruf habe ich gewählt! Tag aus, Tag ein auf der
                Reise.
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="condensed">
condensed
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="69.4%">
69.4%
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding-right="2mm">
<fo:block space-after="1em" font-stretch="extra-condensed">
»was für einen
                anstrengenden Beruf habe ich gewählt! Tag aus, Tag ein auf der Reise.
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="extra-condensed">
extra-condensed
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="57.9%">
57.9%
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding-right="2mm">
<fo:block space-after="1em" font-stretch="ultra-condensed">
»was für einen anstrengenden Beruf habe ich gewählt! Tag aus, Tag ein auf der
                Reise.
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="ultra-condensed">
ultra-condensed
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="48.2%">
48.2%
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding-right="2mm">
<fo:block space-after="1em" font-stretch="semi-expanded">
»was für einen
                anstrengenden Beruf habe ich gewählt! Tag aus, Tag ein auf der Reise.
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="semi-expanded">
semi-expanded
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="120%">
120%
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding-right="2mm">
<fo:block space-after="1em" font-stretch="expanded">
»was für einen anstrengenden Beruf habe ich gewählt! Tag aus, Tag ein auf der
                Reise.
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="expanded">
expanded
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="144%">
144%
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding-right="2mm">
<fo:block space-after="1em" font-stretch="extra-expanded">
»was für einen
                anstrengenden Beruf habe ich gewählt! Tag aus, Tag ein auf der Reise.
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="extra-expanded">
extra-expanded
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="172.8%">
172.8%
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding-right="2mm">
<fo:block space-after="1em" font-stretch="ultra-expanded">
»was für einen anstrengenden Beruf habe ich gewählt! Tag aus, Tag ein auf der
                Reise.
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="ultra-expanded">
ultra-expanded
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="207.4%">
207.4%
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding-right="2mm">
<fo:block space-after="1em" font-stretch="expanded">
»was für einen
                anstrengenden 
<fo:inline font-stretch="wider">
Beruf habe ich
                gewählt! 
<fo:inline font-stretch="wider">
Tag aus, Tag ein
                auf der Reise.
</fo:inline>
</fo:inline>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="expanded">
expanded (
<fo:inline font-stretch="wider">
wider
</fo:inline>
, 
<fo:inline font-stretch="wider">
<fo:inline font-stretch="wider">
wider &
                wider
</fo:inline>
</fo:inline>
)
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="144%">
144% (
<fo:inline font-stretch="172.8%">
172.8%
</fo:inline>
, 
<fo:inline font-stretch="207.4%">
207.4%
</fo:inline>
)
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding-right="2mm">
<fo:block space-after="1em" font-stretch="condensed">
»was für einen anstrengenden 
<fo:inline font-stretch="narrower">
Beruf habe ich gewählt! 
<fo:inline font-stretch="narrower">
Tag aus, Tag ein auf der Reise.
</fo:inline>
</fo:inline>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="expanded">
condensed (
<fo:inline font-stretch="narrower">
narrower, 
<fo:inline font-stretch="narrower">
narrower &
                narrower
</fo:inline>
</fo:inline>
)
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="2mm">
<fo:block font-stretch="69.4%">
69.4% (
<fo:inline font-stretch="57.9%">
57.9%
</fo:inline>
, 
<fo:inline font-stretch="48.2%">
48.2%
</fo:inline>
)
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>

Download the examples

In the output:

Excerpt from the W3C Recommendation:

More information online about

Introduction: "Inline formatting">

Introduction: "Typographic techniques">

Practical example: "Using typographic techniques">

Property description in the CSS reference "font-stretch"

Rendering of the property in the XSL-FO reference

back to top