Thomas DeWeese wrote:
[... text rendering changed between Batik versions ...]
Any explanation for this problem? Anything I can do to avoid it? If it is a bug -- any hints were to dig in the code?
The problem is caused by our switching to use drawGlyphVector in many
cases instead of always drawing raw shapes. Fortunately you can override
this by saying text-rendering="GeometricPrecision". This should give
you the same rendering as before. You might also try 'optimizeLegability"
which will shut off anti-aliasing of the text - some people prefer it.
I don't understand this bit. You changed the code somehow and now the text looks quite different. Is this a feature? Or a bug?
Hi Peter,
One man's feature is another man's bug. It is intentional that we switched to use drawGlyphVector over rendering raw shapes. This has a number of advantages ranging from speed to the ability to render legible text without anti-aliasing. I will however freely admit that the text does look different from before, in some cases quite at bit different.
Is there any specification how the text should look like? The thing I found is this entry:
http://www.w3.org/TR/SVG11/painting.html#TextRenderingProperty
which says that the default setting "auto" ... "Indicates that the user agent shall make appropriate tradeoffs to balance speed, legibility and geometric precision, but with legibility given more importance than speed and geometric precision."
So I assume that you changed the tradeoff policy between the Batik versions. But I must say that I disagree with the choice -- for the purpose of offline-rendering speed doesn't really bother me that much. Is there any way that I can set the behaviour for "auto" from the Java side of things? I want my Java program to prefer precision over speed for any SVG given to it.
This would be a nice feature but currently there is no magic switch
to set the default set of hints that Batik uses for rendering. Contributions
are always welcome!
You can set the text-rendering property on the root of the document
tree before rendering and because of CSS this will then effect all
text nodes (unless someone overrides it).
Hi Thomas,
that doesn't seem to work. If I use this:
<text x="8" y="16" style="filter:url(#Shadow);font-family:Arial;font-size:14;stroke-width:0;stroke-opacity:1;stroke:rgb(220,220,255);fill-opacity:1;fill:rgb(220,220,255);opacity:1;text-rendering:geometricPrecision" id="xweb">oops</text>
Ooops is right. It didn't properly pick up on the hint in JDK 1.4.1 (it worked in 1.3.1).
I get the same look as without the rendering hint. If I use optimizeLegibility instead I do get a slight change, so the hint seems to work, it is just that geometricPrecision doesn't give the same result as the old version (while being the default).
This will be fixed in CVS today.
Is there any reference rendering how text should look like? The old version was pretty much in agreement with Adobe's viewer so I was happy. Now the difference is rather significant. :-( I haven't tried other tools, though.
Is there any way to get the old behavioiur back? I'm happy to hack some more code if I get the right hints ;-)
With the hint behaviour fixed you should get exactly the same rendering as before. Also thinking about this, the simplest way to turn this on is to use a CSS user style sheet. This is already available on the command line of the rasterizer.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]