[ 
https://issues.apache.org/jira/browse/FOP-2293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Seifeddine Dridi updated FOP-2293:
----------------------------------

    Attachment: FO_multi-switch_best-fit_ext_rev8.patch

Hello,

I resumed working on the extension again. In my latest patch, I implemented the 
case where a dynamic content is at an end of page. By simply creating a penalty 
which contains all variants of a dynamic content, and when the penalty is 
evaluated, I search for the first variant that fits w/r to the active node, and 
finally attach it to a new page breaking node. However, the problem is that a 
dynamic content must always fit exactly in the remaining space of the page in 
order to be inserted, which makes the whole extension completely useless.

So what was missing is to add a glue to handle the case where a dynamic content 
is in the middle of a page. If the penalty was not a feasible break, the glue 
will become active. On the contrary, if it led to a valid breaking node, the 
glue will simply be ignored (actually this is a basic property of the Knuth 
algorithm).

I shouldn't tell you that I have thoroughly tested my patch and it works :)

Have a nice day.

Seifeddine

> Whitespace management extension
> -------------------------------
>
>                 Key: FOP-2293
>                 URL: https://issues.apache.org/jira/browse/FOP-2293
>             Project: Fop
>          Issue Type: New Feature
>          Components: general
>    Affects Versions: trunk
>            Reporter: Seifeddine Dridi
>            Priority: Minor
>              Labels: XSL-FO
>             Fix For: trunk
>
>         Attachments: FO_multi-switch_best-fit_ext_rev2.patch, 
> FO_multi-switch_best-fit_ext_rev3.patch, 
> FO_multi-switch_best-fit_ext_rev4.patch, 
> FO_multi-switch_best-fit_ext_rev5.patch, 
> FO_multi-switch_best-fit_ext_rev6.patch, 
> FO_multi-switch_best-fit_ext_rev7.patch, 
> FO_multi-switch_best-fit_ext_rev8.patch, FO_multi-switch_test.fo, 
> FO_multi-switch_with_best-fit_extension.patch, bestfit.fo, doc.pdf, 
> multi-switch_bestfit.fo, multiple-feasible-nodes.fo, patch-rev1.1.patch, 
> patch-rev1.patch, patch-rev2.patch, patch.patch, two-valid-variants.fo
>
>
> I have been working on an extension for whitespace management, similar to 
> what's described here: 
> http://wiki.apache.org/xmlgraphics-fop/WhitespaceManagement
> The logic of the extension is very simple: the user defines a set of 
> alternatives that he wishes to insert at the end of a page, then if there is 
> enough space left, FOP will pick the alternative that best matches the user's 
> selection criteria (first fit, smallest fit, biggest fit).
> This is my first work on FOP and it took me almost 2 months to reach this 
> stage in development. But it's not the end of course, so I'm relying on your 
> feedback to improve it.
> Thank you



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to