Technologies XML / XSL-FO / Référence / Extensions XSL d’Antenna House Formatter / Propriétés / overflow-condense
(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 Extensions de débordement
La propriété axf:overflow-condense définit comment condenser le texte qui déborde dans la région.
Valeur : | letter-spacing | font-stretch | font-size | line-height | auto | none |
Valeur initiale : | auto |
S’applique à : | tous les objets de mise en forme de niveau bloc |
Hérité : | yes |
Pourcentages : | N/A |
Les valeurs ont les significations suivantes.
letter-spacing | Condense le texte en ajustant l’espacement des lettres. |
font-stretch | Condense le texte en ajustant la width. |
Condense le texte en ajustant la taille de police. | |
line-height | Condense le texte en ajustant la hauteur de ligne. |
auto | Dépend du réglage du système. |
none | Indique de ne pas condenser le texte. Cette valeur peut également être spécifiée sur l’élément en ligne et n’est pas héritée. |
La condensation du texte dans la région peut être spécifiée au moyen de overflow="condense". L’ajustement permettant de condenser le texte concerne aussi bien le sens de progression en ligne que le sens de progression des blocs. Le système applique la méthode spécifiée en combinant les méthodes jugées appropriées.
Le processus de condensation diffère selon qu’il s’applique en ligne ou au bloc. La condensation s’effectue en ligne lorsqu’une seule ligne comporte <fo:inline-container> ou <fo:block-container keep-together.within-line="always">, etc. Dans les autres cas, la condensation s’effectue au niveau du bloc.
Une longueur spécifiée par une valeur absolue à l’intérieur du bloc n’est pas ajustée. Par exemple, dans le cas suivant, la longueur reste inchangée.
<fo:block-container width="4in" overflow="condense" axf:overflow-condense="font-size"> this text will be condenced <fo:block font-size="24pt">no condenced text</fo:block> </fo:block-container>
De plus, lorsque l’ajustement du bloc s’effectue par font-size ou font-stretch, text-align-last="justify" est défini implicitement. Spécifiez explicitement text-align-last="left", etc., lorsque justify n’est pas nécessaire.
Exemple XSL-FO :
<fo:root font-family="Arial Unicode MS" font-size="12pt" 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="author" value="Alex Critchfield, Antenna House"/>
<axf:document-info name="keywords" value="extensions, value, overflow"/>
<axf:document-info name="subject" value="overflow extended values"/>
<axf:document-info name="title" value="overflow extended values example"/>
<fo:layout-master-set>
<fo:simple-page-master page-width="8.5in" page-height="11in" master-name="main">
<fo:region-body region-name="body" margin-top="1in" margin-bottom="1in" margin-left=".75in" margin-right=".75in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="main">
<fo:flow flow-name="body">
<fo:block>
The
<fo:wrapper font-weight="bold">
overflow
</fo:wrapper>
property is used determine the behavior of Formatter when the contents of an area format to a size greater than the area's defined boundaries. Antenna House has extended the value of this property to the following values.
<fo:block/>
overflow="replace" allows for replacement of overflowing contents, similar to how spreadsheets replace number too large to display in cells with "*****". The string to replace the overflow with is defined as the value of the extension element axf:overflow-replace.
<fo:block/>
overflow="condense" allows the text to be condensed according to the value of the axf:overflow-condense extension property.
<fo:block/>
These extended values only apply to block-container and inline-container elements.
</fo:block>
<fo:block space-before="10mm" padding="5pt" text-align-last="center" border="2pt solid black">
overflow="none" (default)
<fo:block/>
<fo:inline-container color="blue" font-size="30pt" padding="5pt" text-align-last="center" display-align="center" width="4in" height="1in" border="2pt solid salmon">
<fo:block keep-together="always">
rubber baby buggy bumpers
</fo:block>
</fo:inline-container>
</fo:block>
<fo:block space-before="10mm" padding="5pt" text-align-last="center" border="2pt solid black">
overflow="replace" axf:overflow-replace="#"
<fo:block/>
<fo:inline-container overflow="replace" axf:overflow-replace="#" color="blue" font-size="30pt" padding="5pt" text-align-last="center" display-align="center" width="4in" height="1in" border="2pt solid salmon">
<fo:block keep-together="always">
rubber baby buggy bumpers
</fo:block>
</fo:inline-container>
</fo:block>
<fo:block space-before="10mm" padding="5pt" text-align-last="center" border="2pt solid black">
overflow="condense" axf:overflow-condense="font-size"
<fo:block/>
<fo:inline-container overflow="condense" axf:overflow-condense="font-size" color="blue" font-size="30pt" padding="5pt" text-align-last="center" display-align="center" width="4in" height="1in" border="2pt solid salmon">
<fo:block keep-together="always">
rubber baby buggy bumpers
</fo:block>
</fo:inline-container>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>Résultat :