xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John C. Turnbull" <ozem...@ozemail.com.au>
Subject RE: Text rendering issues - again
Date Mon, 03 Nov 2008 22:08:58 GMT
It seems that achieving LCD sub-pixel antialiasing with Batik may not be


An analysis of a trace log from the Batik code by Dmitri Trembovetski of Sun
has revealed that LCD antialiasing is not happening because the image buffer
in use is not opaque even though I am explicitly setting the rendering hints
to achieve it.  I guess the reason for this is to enable SVG canvasses to be
overlayed one on top of the other and have the underlying graphics "show
through" the top layer.


Does this sound correct?  I mean is this the reason why the image buffer is
not opaque?  Unfortunately LCD antialiasing only works on opaque surfaces.


As an aside, I can get LCD antialiasing to work if I render the glyph vector
into an opaque image and then blast that opaque image on to the image buffer
but this necessitates having a background colour for the text which clears
the rectangle in which the text is bound.  Clearly this is not the solution.


Any thoughts?






From: John C. Turnbull [mailto:ozemale@ozemail.com.au] 
Sent: Thursday, 30 October 2008 07:23
To: batik-users@xmlgraphics.apache.org
Subject: Text rendering issues - again


I thought I had made the necessary modifications to achieve true sub-pixel
antialiasing in Batik but after consultation with Stuart Pook I have found
that this is not the case.  This is proving very problematic.


So, what would prevent Batik from rendering text using true sub-pixel
antialiasing?  I have gone through the entire Batik code base and changed
everything that looked relevant but it still doesn't work.  I have even gone
to the extent of replacing the code in the draw() method of
AWTGVTGlyphVector where the text is actually rendered with this:



graphics2D.setPaint(new Color(0, 0, 0));

graphics2D.setTransform(new AffineTransform());

graphics2D.setFont(new Font("Segoe UI", Font.PLAIN, 13));






graphics2D.setRenderingHint(RenderingHints.KEY_TEXT_LCD_CONTRAST, 120);






graphics2D.drawString("Some test text", 20, 20);


As you can see, I am setting every possible relevant rendering hint to
achieve sub-pixel antialiasing and this code fragment produces the desired
results when used outside of the Batik context.  But within Batik, the text
is rendered using standard antialiasing only.


It seems that something in either the graphics configuration or component
configuration within this Batik method is preventing true sub-pixel
antialiasing from happening even though I am explicitly requesting it.  What
could possibly be causing this?





View raw message