Dear Wiki user,

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

The "RoundedBorders" page has been changed by Peter Hancock.
http://wiki.apache.org/xmlgraphics-fop/RoundedBorders?action=diff&rev1=3&rev2=4

--------------------------------------------------

  This page discusses if and how support for rounded borders in FOP could be 
added.
  
  == The XSL-FO specification ==
- 
- XSL 1.1 doesn't contain support for rounded borders. However, the topic 
appears in the requirements document of XSL-FO 2.0:
+ XSL 1.1 doesn't contain support for rounded borders. However, the topic 
appears in the requirements document of XSL-FO 2.0: 
http://www.w3.org/TR/2008/WD-xslfo20-req-20080326/#N67092
- http://www.w3.org/TR/2008/WD-xslfo20-req-20080326/#N67092
  
  == The CSS3 specification ==
- 
- XSL-FO borrows heavily from CSS (CSS2, actually). The current CSS3 working 
drafts contains a module (called "Backgrounds and Borders") that discuss 
rounded borders:
+ XSL-FO borrows heavily from CSS (CSS2, actually). The current CSS3 working 
drafts contains a module (called "Backgrounds and Borders") that discuss 
rounded borders: http://www.w3.org/TR/css3-background/#the-border-radius
- http://www.w3.org/TR/css3-background/#the-border-radius
  
  == A possible extension for rounded borders ==
- 
  It makes sense to look at CSS3 for the naming and semantics of a rounded 
border feature in FOP since it can be expected that the XSL working group will 
orient themselves at CSS3 for this once (and if) this finds its way into XSL-FO.
  
  CSS3 defines the following properties: '''border-top-right-radius, 
border-bottom-right-radius, border-bottom-left-radius, 
border-top-left-radius''', one for each border edge. The shorthand 
('''border-radius''') lets you define all four borders in one property. As with 
other shorthand, this would be mapped to the four basic properties. Since 
rounded borders are not currently part of XSL-FO, the properties need to be 
prefixed with out "fox:" prefix.
@@ -27, +22 @@

  {{http://people.apache.org/~jeremias/fop/rounded-borders-table1.png}}
  
   1. easily done with the separate border model.
-  2. easily done with the separate border model.
+  1. easily done with the separate border model.
-  3. separate border model if the second row doesn't have a border-before.
+  1. separate border model if the second row doesn't have a border-before.
-  4. not doable (which would be the desired fix for 3)
+  1. not doable (which would be the desired fix for 3)
-  5. easily done even with collapsing border model as only the other border 
segments have rounded borders.
+  1. easily done even with collapsing border model as only the other border 
segments have rounded borders.
  
  CSS3 doesn't seem to be saying anything of the effect of a rounded border on 
the padding rectangle. The text actually suggests that the padding rectangle is 
being clipped. So the user would be responsible to specifying enough padding so 
text does not get clipped at the border line.
  
  == Implementation considerations ==
- 
  Obviously, the FO tree needs to be enhanced with the extension properties and 
the shorthand.
  
  If the above assumption is correct and CSS3 doesn't expect the user agent to 
automatically adjust the padding rectangle according to the border-radius 
properties, then there's no special consideration needed in either the FO tree 
or the layout engine which makes the whole thing easier. Only the layout 
managers need to transport the border-radius information to the area tree.
@@ -53, +47 @@

  Finally, the IFPainter implementations have to implement the actualy 
functionality for each output format.
  
  === Difficulties ===
- 
  In general, painting rounded borders and rectangles in PDF, PostScript, SVG 
and Java2D are not a problem if you figure out how to calculate the starting 
and ending coordinates of border segments. This is especially important when 
adjacent border segments have different color. However the CSS3 spec recommends 
(but doesn't require) that gradients shall be used when rounded borders are 
specified. This would make the calculation of starting points inside the curve 
obsolete but require additional effort to achieve the gradient. A gradient will 
make the output files (PDF and PS only) slightly larger and more complicated 
(slower) to paint by the viewer/RIP.
  
  {{http://people.apache.org/~jeremias/fop/rounded-borders.png}}
@@ -70, +63 @@

  
  PCL doesn't support clipping at all, especially not to shapes that are not 
rectangles. AFP does have limited support to emulate clipping to a rectangle, 
but not arbitrary shapes.
  
+ === Working Implementation ===
+ '''TODO''' The attached document should be merged into this wiki page: 
[[attachment:fox_exts_and_design_decisions]]
+ 
  === Random Notes ===
- 
   * This feature could be used as occasion to fix the mark layering that was 
discovered some time ago.
   * Fixing mark layering would also allow (to a certain degree) to optimize 
border painting (i.e. to combine border segments in tables to reduce 
anti-aliasing artifacts of document viewers). But this is really unrelated to 
the topic at hand.
  
  ----
- 
  [1] These are just a few different variants. Maybe there are more. If anyone 
knows an additional variant that is missing here, please let me know. 
(JeremiasMaerki)
  
  [2] I haven't checked any CSS3 implementations or other FO implementations, 
yet, to see how they do things. (JeremiasMaerki)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to