Yes, Chris, this is "copyfitting" as I understand it -- we have a block of text that may vary in length at runtime that must be fit into a fixed-size block.
I was away on vacation last week, but have finally managed to get back to this and it looks like I can *almost* make my system work using the EventBroadcaster model in FOP 1.0. However, the problem I'm having is I am unable to consistently get a handle on the actual block where the overflow occurred. When the event source isn't a subclass AbstractBaseLayoutManager (such as line overflows from a LineLayoutManager$LineBreakingAlgorithm) I have no way of reliably finding the offending block so that I can make adjustments. The org.xml.sax.Locator is really only for debug messages and not useful for this purpose. My hacked version of 0.95 passed the FObj into the event. Are others using their own EventProducers? I would prefer if possible to patch the existing code instead of making a local fork again...but I'm not sure what the "right" or even the best solution would be. Easiest would be simply adding a new parameter -- FObj -- to the three producer methods I need, however this seems rather messy. Perhaps instead the Locator argument could be replaced with either an FObj arg (not sure if ALL that throw have access to FObj), or some interface that extends Locator but includes a getFObj() method? Thoughts? -Patrick -----Original Message----- From: Chris Bowditch [mailto:[email protected]] Sent: Wednesday, November 03, 2010 7:25 AM To: [email protected] Subject: Re: Copyfitting and Flexible Layout On 28/10/2010 07:44, Jeremias Maerki wrote: Hi Jeremias, sorry for the late reply: > We've written down some thoughts about the topic some time ago: > http://wiki.apache.org/xmlgraphics-fop/WhitespaceManagement > But there were no further actions on this. I just wanted to clarify: copyfitting is different from whitespace management. The difference is that copyfitting is about making adjustments to font sizes and other attributes to make an object of unknown size fit into pre-defined space. The size of the object is not known until runtime but the space we allocate for the object is known at design time. Whitespace management is where we have space of unknown size, e.g. remaining space on a page, and we have several alternative objects. The object chosen to be placed into the space of unknown size, depends on which objects fits the space best at layout stage. I hope I have explained the difference clearly. Thanks, Chris > > On 27.10.2010 20:11:29 Patrick Jaromin wrote: >> Early last year I implemented copyfitting and flexible layouts into our >> FOP-based rendering process by locally branching FOP 0.95, adding my >> own listener/event mechanism and FO extensions, and a pre-processor that >> implements the copyfitting strategies through an iterative process of >> render-modify-render-... >> >> I'm hoping to upgrade to the FOP 1.0 codebase and rather than branching >> and re-implementing my hacks, I'd prefer to extend the base in a more >> maintainable way that perhaps others could also benefit from. >> >> Before I embark on this process (or even discuss it in more depth) I >> figured I'd see if anyone else has made any movements on this or has >> any thoughts. My system uses my own namespace/attributes, however I would >> likely adopt the specifications outlined in XSL:FO 2.0 working draft >> (http://www.w3.org/TR/xslfo20/#req_2_1_4). >> >> Thoughts/Comments? >> >> >> Patrick K. Jaromin >> VP Technology >> 312.943.1600 * fax 312.640.8100 >> >> JGSullivan Interactive, Inc. >> >> > > > > Jeremias Maerki > > >
