xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Urs Reupke" <ursreu...@gmx.net>
Subject Re: Setting Text Colors
Date Sun, 24 Oct 2004 21:06:54 GMT
Hi again, Thomas,

>    My guess would be that the code that is setting the fill on the
> polygon is going overboard and setting the fill on the text as well.

>   One other suggestion, set stroke to a third color (black or
>something) for the text.  This will let you know if the problem is
>that the fill is being set on the text and the background.

I had already checked on this by simply disabling the code for the polygon-fill,
but the behaviour didn't change the slightest.

I tried, however, to follow your suggestion, but the text kept on disappearing.
(The text, however, looked interesting before I triggered my "setTextColor"
method, what part of a text are stroked, what filled? I thought that text-color
was determined only by the fill-attributes, not by stroke.)
 
>    Well it would only be a problem if the style attribute set
> the fill property.  In this case the style will win (the only
> thing presentation attributes override is inherited values).

> If you want to set the CSS value directly you can use:
>    elem.getStyle().setProperty("fill", "red", "");

Unfortunately, I only use CSS to set fontsize and fontfamily.
Using the methods you mentioned I tried to set the textcolor,
resulting in the same behaviour as before.
Asking for the value by calling getPropertyValue invariably returned 
the value I set before, so *that* part of the code seems to work.

I had a hunch that the (totally opaque) polygon might be painted in front
of the text after I clicked, but even setting the polygon opacity to 0 didn't help
the text.

Something else just crosses my mind: Is there anything special I should consider
with the text if it is divided into TSpanElements? After reading the Specification
I thought, that fill-attributes are inherited to all children, but this wouldn't be the
first exception from the rule made for a TextElement.

Good Night,
-Urs

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message