Technologies XML / XSL-FO / Référence / Extensions XSL d’Antenna House Formatter / Propriétés / hanging-punctuation

(Extrait de «XSL-FO ― La Référence » de 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

Catégorie Espacement et ponctuation suspendue

Indique si la ponctuation doit dépasser au début de la ligne ou à la fin de la ligne. [CSS3-Text] Ponctuation suspendue : propriété ‘hanging-punctuation’

Valeur :

none | [ start || first || [ force-end | allow-end ] || last ]

Valeur initiale :

none

S’applique à :

fo:block

Hérité :

yes

Pourcentages :

N/A

Les valeurs ont les significations suivantes.

none

Aucun dépassement de ponctuation au début ou à la fin de la ligne.

start

Fait dépasser la ponctuation au début de la ligne. Si le caractère visé arrive au début, son dépassement est forcé.

first

Comme la valeur start, mais seulement à la première ligne d’un paragraphe.

force-end

Fait dépasser la ponctuation en fin de ligne. Lorsque text-align="right" ou text-align="justify" (ou text-align-last="justify") est défini et qu’un caractère visé termine la phrase, son dépassement est forcé. Pour les autres valeurs de text-align, le dépassement est naturel. La valeur end antérieure à V5 est interprétée comme la valeur allow-end.

allow-end

Fait dépasser la ponctuation en fin de ligne. Avec text-align="right", text-align="justify" ou text-align-last="justify", si le caractère visé termine la phrase, il ne dépasse pas lorsque le texte tient sur une ligne, mais dépasse sinon. Avec les autres valeurs de text-align, le dépassement est naturel.

last

Comme force-end, mais seulement à la fin de la ligne d’un paragraphe.

Les signes de ponctuation concernés sont les suivants.

  • force-end, allow-end
    Japonais ou chinois simplifié

    U+3001

    IDEOGRAPHIC COMMA

    、

    U+3002

    IDEOGRAPHIC FULL STOP

    。

    U+FF0C

    FULLWIDTH COMMA

    ,

    U+FF0E

    FULLWIDTH FULL STOP

    .

    Chinois traditionnel

    U+FE50

    SMALL COMMA

    ﹐

    U+FE51

    SMALL IDEOGRAPHIC

    ﹑

    U+FE52

    SMALL FULL STOP

    ﹒

    U+FF64

    HALFWIDTH IDEOGRAPHIC COMMA

    、

    Autres langues

    Comme pour la valeur last.

  • last
    guillemets, parenthèses fermantes, point, virgule et tiret

  • start, first
    guillemets, parenthèses fermantes et puce

Exemple XSL-FO :

<fo:root xml:lang="en" 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">
<axf:document-info name="document-title" value="Hanging punctuation at the start /end of line"/>
<axf:document-info name="author" value="Antenna House, Inc."/>
<fo:layout-master-set>
<fo:simple-page-master page-height="297mm" page-width="210mm" margin-top="10mm" margin-left="20mm" margin-right="20mm" margin-bottom="10mm" master-name="PageMaster1">
<fo:region-after extent="7mm"/>
<fo:region-body margin-top="0mm" margin-left="0mm" margin-right="0mm" margin-bottom="10mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="PageMaster1">
<fo:static-content flow-name="xsl-region-after">
<fo:block font-size="0.8em" text-align="right" color="green">
<fo:basic-link external-destination="http://www.antennahouse.com/">
Antenna House, Inc.
</fo:basic-link>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body" font-family="serif" font-size="1em" line-height="1.4" axf:hyphenate-hyphenated-word="false" hyphenate="true">
<fo:block span="all" font-family="sans-serif" font-size="2em" font-weight="bold" line-height="2" space-before="1em" space-after="1em" space-before.conditionality="retain" space-after.conditionality="retain" background-color="#EEEEEE">
<fo:block start-indent="1em" end-indent="1em">
Hanging punctuation at the start /end of line
</fo:block>
</fo:block>
<fo:block span="all" space-before="1em" space-after="1em" space-after.conditionality="retain" text-indent="0em" border="1pt solid #9999FF" start-indent="0.5em" end-indent="0.5em" padding="0.5em" text-align="justify">
Specifies whether the hanging punctuation at the start and end of a line is applied. If axf:hanging-punctuation is specified, hanging punctuation is not applied. If start is specified, hanging punctuation is applied at the start of a line. text-align="right" or text-align="justify" can be specified together with the force-end property, then the full-width punctuation comes at the end of a line, it is forced to be hanged. The other settings are explained in this sample. See also XSL/CSS extension in the manual to learn more about the corresponding punctuations.
</fo:block>
<fo:block text-align="justify">
<fo:block font-size="1.2em">
none
</fo:block>
<fo:block-container space-after="0.5em" font-size="1.5em" width="5.5em" axf:hanging-punctuation="none">
<fo:block background="orange" xml:lang="ja">
「あいうえお、
</fo:block>
</fo:block-container>
<fo:block font-size="1.2em">
start
</fo:block>
<fo:block-container space-after="0.5em" font-size="1.5em" width="5.5em" axf:hanging-punctuation="start">
<fo:block background="orange" xml:lang="ja">
「あいうえお、
</fo:block>
</fo:block-container>
<fo:block font-size="1.2em">
force-end
</fo:block>
<fo:block-container space-after="1.5em" font-size="1.5em" width="5.5em" axf:hanging-punctuation="force-end">
<fo:block background="orange" xml:lang="ja">
「あいうえお、
</fo:block>
</fo:block-container>
<fo:block font-size="1.2em">
first
</fo:block>
<fo:block>
The same behavior as start is applied only at the first line of a paragraph.
</fo:block>
<fo:block-container space-after="0.5em" font-size="1.5em" width="5.5em" axf:hanging-punctuation="first">
<fo:block background="orange" xml:lang="ja">
「あいうえお」「かきく
</fo:block>
</fo:block-container>
<fo:block font-size="1.2em">
allow-end
</fo:block>
<fo:block>
When the target character to be hanged comes at the end of a line, it isn't hanged when fitting into a line, it is hanged when not fitting into a line.
</fo:block>
<fo:block-container space-after="0.5em" font-size="1.5em" width="5.5em" axf:hanging-punctuation="allow-end">
<fo:block background="orange" xml:lang="ja">
あいうえお、「かきくけこ、
</fo:block>
</fo:block-container>
<fo:block font-size="1.2em">
last
</fo:block>
<fo:block>
 The same behavior as force-end is applied only at the end line of a paragraph.
</fo:block>
<fo:block-container space-after="1.5em" font-size="1.5em" width="5.0em" axf:hanging-punctuation="last">
<fo:block background="orange" xml:lang="ja">
あいうえおかきくけこ、さしすせそたちつ、
</fo:block>
</fo:block-container>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>

Télécharger les exemples

Sortie :

haut de page