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 Karen Lease <kl...@club-internet.fr> on 2001/07/20 23:15:11 UTC

More table fixes - rendering rectangles

Hi all,

I'm still slogging away with tables, trying to get eliminate border
drawing errors. I think I've made some progress, both in the table and
in the rendering code.

I finally discovered why the background rectangles were hanging out a
pixel or so beyond the borders (at least in PDF). When we want to draw a
filled rectangle, we are using the PDF operator which both fills and
strokes the path. Since there is no way to set the stroke width to 0 (0
means at least 1 device pixel, according to my admittedly ancient PDF
bible), this is drawing a pixel more than the actual size of the
rectangle we are filling. The solution is to use the fill only operator.

In order to reduce the risk of breaking other renderers or other addRect
users, I added a new addFilledRect method which is now used to draw
padding and also borders. PDFRenderer implements this by using the fill
only operator. The base class implements it by calling the existing
addRect method using the same color for fill and stroke.

I'm actually not convinced we need the combined "fill and stroke"
addRect method, especially since it has no parameter for specifying the
stroke width. Any comment from other non-PDF renderer experts?

I also am "experimenting" with drawing borders using addFilledRect
instead of addLine. The problem with addLine in PDF is that it centers
the stroke on the specified path, thus sometimes leading to pixel errors
with respect to the background or other border lines. The only kind of
border-style which the PDF line operator could really help us with is
"dashed" (maybe dot, if we use really small dashes), and we're not doing
them yet anyway. If anyone else has a better way to eliminate the
potential pixel errors using stroke, please have at it.

At least for now, I finally have tables which are completely "clean"!

Regards,
Karen

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: More table fixes - rendering rectangles

Posted by Ralph LaChance <Ra...@compuserve.com>.
At 11:15 PM 7/20/01 +0200, you wrote:
>I'm still slogging away with tables, trying to get eliminate border
>drawing errors. I think I've made some progress, both in the table and
>in the rendering code.
>
>I finally discovered why the background rectangles were hanging out a
>pixel or so beyond the borders (at least in PDF). When we want to draw a
>filled rectangle, we are using the PDF operator which both fills and
>strokes the path. Since there is no way to set the stroke width to 0 (0
>means at least 1 device pixel, according to my admittedly ancient PDF
>bible), this is drawing a pixel more than the actual size of the
>rectangle we are filling.

We submitted a patch last week to correct errors in border
rendering in AWTRenderer.



         ' Best,
         -Ralph LaChance



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org