Manuel Mall wrote:
These two paragraphs confuse me - sorry. My understanding was:
discard = start/end borders/padding only at the start and end of the
whole fo:inline
retain = as discard plus start/end borders/padding on the start and end
of every line the fo:inline spans.
Sorry, you are completely right, I did not understand you were referring
to the "extra" borders needed around a line break.
What we need is one or more elements whose overall behaviour is this:
- they represent a space (or another legal break point)
- if they are not used as a break, they behave like a normal space (or
like a not-used hyphenation point)
- if they are chosen as a break, they must add something both at the end
of the line they end, and at the beginning of the next line
This is quite similar to the behaviour of the sequence of elements
representing a space in a centered text (in the
TextLM.getNextKnuthElements() method); so, in this case we could use:
1 glue width = border/padding at the end of the line = A
2 penalty width = 0, value = 0
3 glue width = space.opt - (A + B),
stretch = space.max - space.opt
shrink = space.opt - space.min
4 box width = 0
5 penalty width = 0, value = infinity
6 glue with = border/padding at the beginning of the line = B
so:
- element 1 is a legal break point, but it is never chosen as 2 is better
- element 2 is a legal break point: if it is chosen, the ending line will
reserve a width of A for border and padding, and the next line will
reserve a width of B (the glue 3 is discarded)
- element 3 is NOT a legal break because of the preceding penalty
- element 5 is NOT a legal break because of its value
- element 6 is NOT a legal break because of the preceding penalty
- is there is no break, the overall width is A + (space.opt - (A + B)) + B
= space.opt
In order to make all this work, the TextLM should
- know that it is working on text with non-conditional borders
- "combine" this sequence with the one it would create in a "normal"
situation
Regards
Luca