xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Xmlgraphics-fop Wiki] Update of "ImprovedKeeps" by JeremiasMaerki
Date Thu, 03 Apr 2008 10:07:24 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Xmlgraphics-fop Wiki" for change notification.

The following page has been changed by JeremiasMaerki:
http://wiki.apache.org/xmlgraphics-fop/ImprovedKeeps

The comment on the change is:
Some ideas for advanced keeps and an illustration

------------------------------------------------------------------------------
   
   * Investigation on how to best implement inline keeps.
  
+ == Example of Integer Values in Keeps ==
+ 
+ [http://people.apache.org/~jeremias/fop/keep-levels.png]
+ 
+ [http://people.apache.org/~jeremias/fop/keep-levels.svg SVG version]
+ 
+ == Random thoughts ==
+ 
+ The above example shows that, for a given sequence of formatting objects, we need to collect
the different integer values on the keeps (Set<Integer>). In the first attempt, we break
with all keep != auto as if they are specified as keep="always".
+ 
+ If that results in an overflow, we set the minimum strength to the second to lowest integer
value (2 in the above case). In terms of the Knuth model, the penalties for the breaks with
strength 1 are set to p=INFINITY-1 (discouraged but not illegal break). All others remain
on p=INFINITY.
+ 
+ If that still results in an overflow, the minimum strength is set to the next higher integer
value in the set (3 in the above case). And so on. If there is still an overflow when the
minimum strength is on the last integer of the set, Integer.MAX_VALUE is assumed and only
keeps with strength "always" are set to p=INFINITY. If there is still an overflow, it is reported
to the user by normal means.
+ 
+ This means we may have to build a special !KnuthPenalty class which knows that it's a "keep
penalty" and holds the highest applicable keep strength. The breaking algorithm has to be
extended so it can re-run the breaking process with changed settings for the minimum keep
strength.
+ 
+ === Implementation Stages ===
+ 
+ Advanced keeps could be implemented in two stages:
+ 
+  1. First, we just make a difference between "always" and any integer. "always" will result
in p=INFINITY and <integer> will result in p=INFINITY-1. That resolves at least the
problem over overflowing pages in most cases.
+ 
+  2. As a second step, the full implementation is put in place.
+ 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message