Peter Becker wrote:
Thomas DeWeese wrote:
Peter Becker wrote:
the text rendering just won't change, independent of the hints given -- did you commit the change mentioned below or shall I just wait a bit longer?
It is in there, and it does change the rendering.
Oh, you are right -- it does change and it is actually not too bad at all. I was just too much into comparing it with the old one, and it is definetely not the same as that. But once I compared the three I must say that the newest one is the best.
Good, I am glad you hear you say that :)
In respect to the idea at the end of using a user stylesheet: that might be an option -- if I could provide the CSS. But I'd like to provide it as String (or similar), not as URI since I'd like to code it into my program as the defaults. I might be able to get some URI into a jar file that I could use, but it would be rather complicated to change the little default setting.
Not really this sort of thing is done all the time. I suggest you
look up how resources are used in Java. This is a relly nice technique.
Hmmm... it needs at least an extra file which logically belongs to one bit of code but has to be added in the jar-packaging process. I'll look into it but I suspect I will have to make some assumptions between code and classpaths -- and that just for changing one default. I'd prefer to set transcoding hints for the corresponding CSS rendering hints that have "auto". Are there more than two?
There are around four sets of hints (text, shape, image, color) check the SVG specification - they are all setup in the CSSUtilities class.
>And wouldn't the user stylesheet override the standard entries in the file's CSS? That wouldn't be what I want, I just want to change the default.
This really depends on how the CSS and user content is written - it
is possible to write a fairly non-intrusive CSS rule to set this.
The thing is that I would prefer not to make any assumptions about the user content. Is that possible?
So a presentation attribute AFAIK always looses to CSS - but people using presentation attributes should know that.
That wasn't exactly what I was looking for -- I was trying to work out where the rendering hints are set and where the defaults come from. Is it right that (hints == null) means "use defaults"?
It really means use your parent element's hints.
In that case I am still a bit suspicious about line 177ff of SVGTextElementBridge:
RenderingHints hints = CSSUtilities.convertTextRendering(e, null); hints = CSSUtilities.convertColorRendering(e, hints); if (hints != null) { node.setRenderingHints(hints); }
Shouldn't the two sets of rendering hints be independent? If either of them is set, hints won't be null, thus neither default will be used. Or did I get it all wrong?
The hints all layer on top of one another and there are some cross dependencies. So for example shape-rendering="geometricPrecision" turns on 'pure stroking' which will effect 'complex' text rendering (text with complex fills or strokes). I believe the above code is correct, it essentially says set any 'text' hints then add in any color hints if either of the added any new hint values then set that on the graphics node.
What you really want to do is adjust the rendering hints that are set on the root graphics node - this would most easly be done by the BridgeContext - or done after the fact. If you change the code so 'auto' always sets a group of hints on the graphics node then things will be a little funny in the code (because of how CSS properties inherit you would probably get away with it).
Peter
[...]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]