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 George Yi <gy...@srds.com> on 2003/01/16 22:27:19 UTC

PS Renderer Enhancement

SEG_QUADTO was not implemented in PSGraphics2D.java, which resulted in the
rendering of text portion of SVG unpredictable. Unlike the SEG_CUBICTO which
has a corresponding "curveto" PS command, QUADTO doesn't have a PS command
to be directly related to. But we can use "curveto" PS command to achieve
the QUADTO effect by treating the first two control points as the same
point. ( i.e. P1, P1, P2, curveto == P1, P2, QUADTO )
The actual implementation is very simple.

832a833,839
>                 psRenderer.write(PDFNumber.doubleOut(1000 * vals[0]) + " "
>                                  + PDFNumber.doubleOut(1000 * vals[1]) + "
"
>                                  + PDFNumber.doubleOut(1000 * vals[0]) + "
"
>                                  + PDFNumber.doubleOut(1000 * vals[1]) + "
"
>                                  + PDFNumber.doubleOut(1000 * vals[2]) + "
"
>                                  + PDFNumber.doubleOut(1000 * vals[3])
>                                  + " curveto");


George

RE: PS Renderer Enhancement

Posted by George Yi <gy...@srds.com>.
Please ignore this implementation. It's incorrect.
I will keep working on it though:-)

-----Original Message-----
From: George Yi [mailto:gyiii@srds.com]
Sent: Thursday, January 16, 2003 3:27 PM
To: fop-dev@xml.apache.org
Subject: PS Renderer Enhancement


SEG_QUADTO was not implemented in PSGraphics2D.java, which resulted in the
rendering of text portion of SVG unpredictable. Unlike the SEG_CUBICTO which
has a corresponding "curveto" PS command, QUADTO doesn't have a PS command
to be directly related to. But we can use "curveto" PS command to achieve
the QUADTO effect by treating the first two control points as the same
point. ( i.e. P1, P1, P2, curveto == P1, P2, QUADTO )
The actual implementation is very simple.

832a833,839
>                 psRenderer.write(PDFNumber.doubleOut(1000 * vals[0]) + " "
>                                  + PDFNumber.doubleOut(1000 * vals[1]) + "
"
>                                  + PDFNumber.doubleOut(1000 * vals[0]) + "
"
>                                  + PDFNumber.doubleOut(1000 * vals[1]) + "
"
>                                  + PDFNumber.doubleOut(1000 * vals[2]) + "
"
>                                  + PDFNumber.doubleOut(1000 * vals[3])
>                                  + " curveto");


George


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