Hi Andreas,
thanks for taking care of this and your valuable updates!
> > On 2015-07-22 Andreas L. Delmelle wrote:
>
> I played around with the sample attached to FOP-1444 and trimmed it
> down a bit.
> See below for the most minimal sample that is guaranteed to reproduce
> the issue, and demonstrates that it is not related to the extra
> fo:inline per se, as I first suspected, but rather by the keep-
> together.within-line property.
>
I've removed whitespace between all inlines (spaces seem to influence this
behaviour significantly) and I can confirm that 'keep*' property has some
influence here.
<fo:flow flow-name="xsl-region-body">
<fo:block text-align="start" text-align-last="justify"
id="block-1">
<fo:inline keep-together.within-line="always"><fo:basic-link
internal-destination="id-1">Lorem ipsum</fo:basic-link><fo:leader
leader-alignment="reference-area" keep-with-next.within-line="always"
leader-pattern="rule"/><fo:basic-link
internal-destination="id-1">7</fo:basic-link></fo:inline>
</fo:block>
<fo:block text-align="start" text-align-last="justify"
id="block-2">
<fo:inline><fo:basic-link internal-destination="id-1">Lorem
ipsum</fo:basic-link><fo:leader leader-alignment="reference-area"
keep-with-next.within-line="always"
leader-pattern="rule"/><fo:basic-link
internal-destination="id-1">7</fo:basic-link></fo:inline>
</fo:block>
</fo:flow>
While I initialy expected zero and non-zero ipdAdjust, I am getting rather
two non-zero values which slightly differ (1398 vs 1393).
When that 'keep*' attribute is removed or when wrapping fo:inline elements
are removed completely in both cases, both ipdAdjust are same, but still
non-zero (which I would expect).
The part of logic behind can be found in TextLayoutManager.addMappingAreas()
> Very likely, the specified keep-together results in one or more extra
> elements that throw off the breaking algorithm.
This makes sense. But I am afraid I can't help here much.
While it would be nice to fix it, this can be eliminated by changes in the
source XSL-FO. The value keep-together.within-line="always" in TOC seems to
be unnecessary, even causing problems in case of long titles which need to
be broken to the next line.
Thanks, Jan