You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Jeremias Maerki <de...@greenmail.ch> on 2005/03/17 23:29:05 UTC

Plan: Branch for page breaking

Ok, I'm pretty much ready now. But first: A big THANK YOU to Luca for
sharing with me/us his page breaking code he wrote last year and giving
me the permission to build on and publish it. That provided me with a
good head start. At first I was a bit overwhelmed by the amount of code.
But after extracting smaller methods from very big ones the whole thing
was easily be broken down and got easier to understand at the same time.
My first task was to merge Luca's new code with the code in CVS HEAD so
we don't loose (hopefully) any work done in the meantime (since around
Oct 2004).

The code is already surprisingly stable and reuses much of the code for
line breaking. Says something about the stability of the overall approach.
I've now locally resurrected a few basic things (Luca had already done
fo:block) and after that block-containers. I'm very confident now that
this approach will pay off. So again, thank you, Luca.

Here's the plan:

I'd like to tag CVS HEAD tomorrow and then branch it and commit my local
working copy to that branch. From there I'll continue to work on static
regions, lists and finally tables (actually resurrecting that
functionality). It turns out that after creating the basic Knuth
infrastructure in the LMs it's surprisingly easy to recreate/reuse the
functionality that grew over the last few months in CVS HEAD.

Luca's code contains several Italian comments and System.outs but I hope
you will overlook that for the moment. I'm replacing those with English
comments as I go. Furthermore, I left most of the old getNextBreakPoss()
code in there for reference. These parts will be purged prior to merging
the code back into CVS HEAD. I also expect that some refactoring will be
necessary in certain parts to beautify certain parts that suffered from
my tearing apart the code and trying to reuse as much as possible of the
page breaking code for laying out block-containers (and static regions).

Once everything is checked in, I invite everyone to have a look at the
new parts and help improve them. Luca already told me that he might have
some time to help next month which I look forward to. Luca will also
need to help a bit with his custom extensions of the spec for better
book-style layout. I've taken these parts over but haven't tested them,
yet, as they are not very high on my priorities.

An important issue I currently see is markers and page-number(-citation).
They will need some special attention with the new approach. I've left
them off so far.

I want the branch to be as short-lived as possible. The main reason for
the branch is that I don't want the code to block anyone working on
other parts in FOP (like Renaud on the renderers). Another is my
aversion against huge patches that need to be improved repeatedly. The
nice side-effect is that others can help me. As soon as we have most
functionality back that already exists in CVS HEAD and everyone is happy
with the new code/approach, I want to merge the branch back into CVS
HEAD and discard the branch. I expect that this will happen at the
beginning of Mai (at the current rate of progress I experienced so far).

Failure criteria:
- If the branch should fail to convince everyone until 2005-04-20 that
we're on the right track (technical showstoppers found), we delete the
branch and take a step back again. I pretty much convinced by now that
it won't happen but this needs to be adressed here.

Branch exit criteria:
- At least 80% of the functionality of the current CVS HEAD works again.
- Markers must work again.
- At least one of the showstoppers that we found for the old non-Knuth
approach must be proven to work with the new approach (for example,
table footers)
- None of the layoutengine testcases fail with an exception (they may
fail in the checks though)
- A path for implementing side-floats later should be visible.

I'm sure there are still a few challenging parts hidden in there, but I
think we stand a much better chance of handling them with the Knuth
approach than with the old one.

This is so much prose (sorry), that I guess one or another will have
some comments and/or additions. I hope you won't mind me creating the
branch tomorrow. I got the impression that everyone seems to agree with
the general concept. The last details can be sorted out during the next
few days if necessary.


Jeremias Maerki


Re: Plan: Branch for page breaking

Posted by Jeremias Maerki <de...@greenmail.ch>.
Actually, I am in a rush. :-) And I don't want it to take several months.
That's why I defined failure and exit criteria for the branch. As Chris
noted, this must not become another Alt-Design.

On 18.03.2005 19:41:34 Glen Mazza wrote:
> Take your time, you're not in a rush.  This could very
> well take several months to get everything nailed
> down.  Feel free to integrate changes back into HEAD
> as you see fit, and request help as you need it.
> 
> Glen
> 
> --- Jeremias Maerki <de...@greenmail.ch> wrote:
> > Branch created, initial commit done. For those
> > interested, please check
> > out with tag: Temp_KnuthStylePageBreaking
> > 
> > Merge start point is called:
> > Root_Temp_KnuthStylePageBreaking
> > 
> > Jeremias Maerki
> > 
> > 



Jeremias Maerki


Re: Plan: Branch for page breaking

Posted by Jeremias Maerki <de...@greenmail.ch>.
Branch created, initial commit done. For those interested, please check
out with tag: Temp_KnuthStylePageBreaking

Merge start point is called: Root_Temp_KnuthStylePageBreaking

Jeremias Maerki


Re: Plan: Branch for page breaking

Posted by Renaud Richardet <re...@gmail.com>.
Jeremias,

Your prose sound _very_  good to me, looking forward to see your code.
Keep up!

Renaud

Re: Plan: Branch for page breaking

Posted by Jeremias Maerki <de...@greenmail.ch>.
Clarification: page-number work inside static-content (in my local code),
but not inside a flow.

On 18.03.2005 11:03:38 Jeremias Maerki wrote:
> Hmm, I'm not sure about page-number-citations but with page-numbers I
> got the impression that we need to change the time when they are looked
> up because I always got the first page back. The page is resolved when
> the Knuth element is created which is too soon. But maybe I also broke
> something when I merged your code with CVS HEAD.



Jeremias Maerki


Re: Plan: Branch for page breaking

Posted by Jeremias Maerki <de...@greenmail.ch>.
On 18.03.2005 10:50:10 Luca Furini wrote:
> 
> Jeremias Maerki wrote:
> 
> >I'd like to tag CVS HEAD tomorrow and then branch it and commit my local
> >working copy to that branch. From there I'll continue to work on static
> >regions, lists and finally tables (actually resurrecting that
> >functionality).
> 
> In the last two weeks I worked on lists, and they now work. If you agree,
> I could commit these changes to the new branch next week or (at the
> latest) the following one, removing an item from your to-do list :-)

Cool, I hope you don't have to change too much after my modifications to
your code.

> >Luca will also
> >need to help a bit with his custom extensions of the spec for better
> >book-style layout. I've taken these parts over but haven't tested them,
> >yet, as they are not very high on my priorities.
> 
> I'll be happy to explain and discuss these extensions with you all; I
> think they really come in useful in the creation of book-style documents.

I'd appreciate if you would create a short Wiki page for that.

> >An important issue I currently see is markers and page-number(-citation).
> >They will need some special attention with the new approach. I've left
> >them off so far.
> 
> Page number citations still work (and I don't remember modifying
> anything), at least in some cases: for example, I created a file with
> several page-sequences representing chapters, each one with many sections
> and subsections, and another page-sequence for the table of contents, and
> page-number-citations worked.

Hmm, I'm not sure about page-number-citations but with page-numbers I
got the impression that we need to change the time when they are looked
up because I always got the first page back. The page is resolved when
the Knuth element is created which is too soon. But maybe I also broke
something when I merged your code with CVS HEAD.

BTW, I'm currently working on resurrecting static-content regions.

Jeremias Maerki


Re: Plan: Branch for page breaking

Posted by Jeremias Maerki <de...@greenmail.ch>.
No, multi-column layout is not adressed, yet. The code is still very
basic. But I think with the list of Knuth elements available this will
be relatively simple to achieve.

On 18.03.2005 02:21:21 Glen Mazza wrote:
> BTW, Jeremias, does the new code take into account
> column-balancing for a span-reference-area?  We don't
> have that in our current branch.[1, line 504]
> 
> Thanks,
> Glen
> 
> [1] http://tinyurl.com/6y4np
> 
> 
> --- Glen Mazza <gr...@yahoo.com> wrote:
> > --- Jeremias Maerki <de...@greenmail.ch>
> > wrote:
> > >
> > > Once everything is checked in, I invite everyone
> > to
> > > have a look at the
> > > new parts and help improve them. 
> > >
> > 
> > Great!  That's a very nice offer.  I hope to be able
> > to help out some on the new branch and will cease my
> > LM work now on HEAD.  (Thanks Simon and Chris for
> > your
> > comments on the matter.)
> > 
> > Glen
> > 
> > 



Jeremias Maerki


Re: Plan: Branch for page breaking

Posted by Glen Mazza <gr...@yahoo.com>.
--- Jeremias Maerki <de...@greenmail.ch> wrote:
>
> Once everything is checked in, I invite everyone to
> have a look at the
> new parts and help improve them. 
>

Great!  That's a very nice offer.  I hope to be able
to help out some on the new branch and will cease my
LM work now on HEAD.  (Thanks Simon and Chris for your
comments on the matter.)

Glen