Technologies XML / XSL-FO / Référence / Extensions XSL d’Antenna House Formatter / Propriétés / text-autospace
(Extrait de « XSL-FO ― Die Referenz » 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 alignement >> Ajout d’espace
La propriété axf:text-autospace définit s’il faut ajouter de l’espace autour des glyphes idéographiques. [CSS3-Text] Ajout d’espace : la propriété ‘text-autospace’
Valeur : | none | [ ideograph-numeric || ideograph-alpha || ideograph-parenthesis ] | auto |
Valeur initiale : | auto |
S’applique à : | tous les objets de mise en forme de niveau bloc ou en ligne |
Hérité : | yes |
Pourcentages : | N/A |
Les valeurs ont les significations suivantes.
none | Aucun espace n’est ajouté. |
ideograph-numeric | Un espace est ajouté entre un caractère idéographique et un caractère numérique non idéographique. Celui-ci désigne ici un caractère de catégorie Nd selon Unicode et n’étant pas de pleine chasse. |
ideograph-alpha | Un espace est ajouté entre un caractère idéographique et un caractère alphabétique non idéographique, c’est-à-dire un caractère des catégories Unicode Lu, Ll, Lt ou Lm. |
ideograph-parenthesis | Un espace est ajouté entre un caractère idéographique et une parenthèse non idéographique. Aucun espace n’est toutefois ajouté entre un caractère idéographique et une parenthèse fermante non idéographique, ni entre une parenthèse ouvrante non idéographique et un caractère idéographique. |
auto | Dépend du réglage du système. Selon ce réglage, la valeur est traitée comme "none" ou "ideograph-numeric ideograph-alpha". |
Le réglage initial de l’ajout d’espace peut être défini par text-autospace dans le fichier de configuration des options. Ce réglage est également disponible dans la boîte de dialogue de configuration des options de mise en forme de l’interface graphique.
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="Space between Japanese and Western languages"/>
<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">
Space between Japanese and Western languages
</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">
Here is a setting of automatically inserting a space between Japanese and Western languages. No space is entered when axf:text-autospace is specified as none. A space is entered between Kanji/Kana and European languages if ideograph-numeric is set. Likewise, a space is entered between Kanji/Kana and alphabets with ideograph-alpha, and between Kanji/Kana and Western language parenthesis with ideograph-prenthesis (however, a space will be entered outside the parenthesis only). A space between Japanese and Western languages can be specified with the value of axf:text-autospace-width.
</fo:block>
<fo:block text-align="justify" language="ja">
<fo:block>
none
</fo:block>
<fo:block-container font-size="1.5em">
<fo:block axf:text-autospace="none">
漢0漢X漢(漢)漢[漢]漢{漢}漢
</fo:block>
</fo:block-container>
<fo:block>
ideograph-numeric + ideograph-alpha
</fo:block>
<fo:block-container font-size="1.5em">
<fo:block axf:text-autospace="ideograph-numeric ideograph-alpha">
漢0漢X漢(漢)漢[漢]漢{漢}漢
</fo:block>
</fo:block-container>
<fo:block>
ideograph-parenthesis
</fo:block>
<fo:block-container font-size="1.5em" xml:lang="ja">
<fo:block axf:text-autospace="ideograph-parenthesis">
漢0漢X漢(漢)漢[漢]漢{漢}漢
</fo:block>
</fo:block-container>
<fo:block space-before="1.0em">
ideograph-numeric + ideograph-alpha + ideograph-parenthesis, axf:text-autospace-width="0.125em"
</fo:block>
<fo:block-container font-size="1.5em">
<fo:block axf:text-autospace="ideograph-numeric ideograph-alpha ideograph-parenthesis" axf:text-autospace-width="0.125em">
漢0漢X漢(漢)漢[漢]漢{漢}漢
</fo:block>
</fo:block-container>
<fo:block>
ideograph-numeric + ideograph-alpha + ideograph-parenthesis, axf:text-autospace-width="0.25em"
</fo:block>
<fo:block-container font-size="1.5em">
<fo:block axf:text-autospace="ideograph-numeric ideograph-alpha ideograph-parenthesis" axf:text-autospace-width="0.25em">
漢0漢X漢(漢)漢[漢]漢{漢}漢
</fo:block>
</fo:block-container>
<fo:block>
ideograph-numeric + ideograph-alpha + ideograph-parenthesis, axf:text-autospace-width="0.5em"
</fo:block>
<fo:block-container font-size="1.5em">
<fo:block axf:text-autospace="ideograph-numeric ideograph-alpha ideograph-parenthesis" axf:text-autospace-width="0.5em">
漢0漢X漢(漢)漢[漢]漢{漢}漢
</fo:block>
</fo:block-container>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>Résultat :