Tecnologías XML / XSL-FO / Referencia / Extensiones XSL de Antenna House Formatter / Propiedades / hanging-punctuation
(Extracto de «XSL-FO ― La Referencia» 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
Categoría Espaciado y puntuación colgante
Indica si la puntuación debe sobresalir al principio de la línea o al final de la línea. [CSS3-Text] Puntuación colgante: propiedad ‘hanging-punctuation’
Valor: | none | [ start || first || [ force-end | allow-end ] || last ] |
Valor inicial: | none |
Se aplica a: | |
Heredado: | yes |
Porcentajes: | N/A |
Los valores tienen estos significados.
none | Sin puntuación sobresaliente al principio ni al final de línea. |
start | Hace sobresalir la puntuación al principio de línea. Si el carácter afectado llega al principio, se fuerza su salida. |
first | Como el valor start, pero solo en la primera línea de un párrafo. |
force-end | Hace sobresalir la puntuación al final de línea. Cuando text-align="right" o text-align="justify" (o text-align-last="justify") está definido y un carácter afectado termina la frase, se fuerza su salida. Con otros valores de text-align, la salida es natural. El valor end anterior a V5 se interpreta como el valor allow-end. |
allow-end | Hace sobresalir la puntuación al final de línea. Con text-align="right", text-align="justify" o text-align-last="justify", si el carácter afectado termina la frase, no sobresale cuando el texto cabe en una línea, pero sí en caso contrario. Con otros valores de text-align, la salida es natural. |
last | Como force-end, pero solo al final de la línea de un párrafo. |
Los signos de puntuación afectados son los siguientes.
force-end, allow-end
Japonés o chino simplificadoU+3001
IDEOGRAPHIC COMMA
、
U+3002
IDEOGRAPHIC FULL STOP
。
U+FF0C
FULLWIDTH COMMA
,
U+FF0E
FULLWIDTH FULL STOP
.
Chino tradicional
U+FE50
SMALL COMMA
﹐
U+FE51
SMALL IDEOGRAPHIC
﹑
U+FE52
SMALL FULL STOP
﹒
U+FF64
HALFWIDTH IDEOGRAPHIC COMMA
、
Otros idiomas
Como el valor last.
last
comillas, paréntesis de cierre, punto, coma y guionstart, first
comillas, paréntesis de cierre y viñeta
Ejemplo 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>Salida: