You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Mathias Kalb <ma...@prodato.de> on 2005/04/13 16:59:41 UTC

Problems with TextNode in Batik 1.6

Hello,

I use Batik 1.5.1 and now I am testing Batik 1.6.
I have a problem with the TextNode. I have a class which extends
"org.apache.batik.gvt.TextNode". This class calls
super.setAttributedCharacterIterator(...).
When I use Batik 1.5.1 I see this TextNode but with Batik 1.6 I do not
see it.

Can anyone help?

Thanks!
Mathias Kalb

-- 
ProDatO Integration Technology GmbH
Hauptstrasse 60, 91054 Erlangen
http://www.prodato.de

Mathias Kalb, Dipl.-Inf. (FH)
mailto:mathias.kalb@prodato.de
fon: +49-9131-612877
fax: +49-9131-612881

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


KEY_AOI - batik 1.6

Posted by Nacho <Ig...@cern.ch>.
Hello,

I´m trying to print only certain areas of a svg image using KEY_AOI.
I wanted to try in 1.6 since I had problems with 1.5.1, and it looks 
like some problems in print transcoder were fixed in this new release.

I wanted first to clarify some aspects of this KEY_AOI value, because it 
is not clear to me.

I have a SVG Document with a ViewBox like [-100 -2200 3400 2300]
And this document is displayed in a canvas with dimensions (in pixels) 
[Width: 900, Height: 400]

If I wanted, for example, to print only half of the svg document, which 
values do I have to introduce in the AOI?
The value I enter is supposed to be in pixels, and with non-zero values, 
as far as I understand.

But if I introduce the rectangle [0 0 900 200] (upper half of the pixel 
area), it will print nothing at all, in this new 1.6 release (as with 
the previous one).
I introduce as well the width and height values as KEY_WITH and KEY_HEIGHT.

The only time when I could actually print something was modifying the 
example in the batik web page (Image Transcoder Tutorial), but I suspect 
that it was because the view box of the sample picture (anne.svg) 
doesn´t have negative values (it is [0 0 xx xx]).Are these negative 
values a problem?

Any feedback will be appreciated,

Cheers,

Nacho








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


Re: Problems with TextNode in Batik 1.6

Posted by Mathias Kalb <ma...@prodato.de>.
Hi Thomas,

I works :-)

Thank you very much!!!
Mathias Kalb


Thomas DeWeese wrote:

> Hi Mathias,
> 
>    Ahh, now the light goes on.  We added support for
> display/visibility to text so there is a new member of
> TextPaintInfo: 'visible', and it defaults to 'false'.
> So I suspect that all you need to do is add:
> 
>     paintInfo.visible = true;
> 
>    Please let us know if this solves the problem.
> 
> Mathias Kalb wrote:
> 
>> Yes, I create the following TextPaintInfo.
>>
>>     TextPaintInfo paintInfo = new TextPaintInfo();
>>     paintInfo.fillPaint = inheritedFillColor;
>>     paintInfo.strokePaint = inheritedStrokeColor;
>>     paintInfo.strokeStroke = inheritedStroke;
>>
>> And the values are:
>> inheritedFillColor = a Color-Object
>> inheritedStrokeColor = null
>> inheritedStroke = a BasicStroke-Object
>>
>> Thanks!
>> Mathias Kalb
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 
> 
> 


-- 
ProDatO Integration Technology GmbH
Hauptstrasse 60, 91054 Erlangen
http://www.prodato.de

Mathias Kalb, Dipl.-Inf. (FH)
mailto:mathias.kalb@prodato.de
fon: +49-9131-612877
fax: +49-9131-612881

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


Re: Problems with TextNode in Batik 1.6

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Mathias,

    Ahh, now the light goes on.  We added support for
display/visibility to text so there is a new member of
TextPaintInfo: 'visible', and it defaults to 'false'.
So I suspect that all you need to do is add:

	paintInfo.visible = true;

    Please let us know if this solves the problem.

Mathias Kalb wrote:

> Yes, I create the following TextPaintInfo.
> 
>     TextPaintInfo paintInfo = new TextPaintInfo();
>     paintInfo.fillPaint = inheritedFillColor;
>     paintInfo.strokePaint = inheritedStrokeColor;
>     paintInfo.strokeStroke = inheritedStroke;
> 
> And the values are:
> inheritedFillColor = a Color-Object
> inheritedStrokeColor = null
> inheritedStroke = a BasicStroke-Object
> 
> Thanks!
> Mathias Kalb
> 


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


Re: Problems with TextNode in Batik 1.6

Posted by Mathias Kalb <ma...@prodato.de>.
Thomas DeWeese wrote:

> Mathias Kalb wrote:
> 
>> I found out that the problem is the method getPrimitiveBounds() in
>> the class TextNode. It contains:
>> primitiveBounds = textPainter.getBounds2D(this);
>>
>> The value of "primitiveBounds" is null.
>> I create the AttributeCharacterIterator (aci) and maybe I have
>> to add something.
> 
> 
>    Do you provide a TextPaintInfo property for the ACI? with
> a non-null fill or stroke?

Yes, I create the following TextPaintInfo.

     TextPaintInfo paintInfo = new TextPaintInfo();
     paintInfo.fillPaint = inheritedFillColor;
     paintInfo.strokePaint = inheritedStrokeColor;
     paintInfo.strokeStroke = inheritedStroke;

And the values are:
inheritedFillColor = a Color-Object
inheritedStrokeColor = null
inheritedStroke = a BasicStroke-Object

Thanks!
Mathias Kalb

-- 
ProDatO Integration Technology GmbH
Hauptstrasse 60, 91054 Erlangen
http://www.prodato.de

Mathias Kalb, Dipl.-Inf. (FH)
mailto:mathias.kalb@prodato.de
fon: +49-9131-612877
fax: +49-9131-612881

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


Re: Problems with TextNode in Batik 1.6

Posted by Thomas DeWeese <Th...@Kodak.com>.
Mathias Kalb wrote:

> I found out that the problem is the method getPrimitiveBounds() in
> the class TextNode. It contains:
> primitiveBounds = textPainter.getBounds2D(this);
> 
> The value of "primitiveBounds" is null.
> I create the AttributeCharacterIterator (aci) and maybe I have
> to add something.

    Do you provide a TextPaintInfo property for the ACI? with
a non-null fill or stroke?

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


Re: Problems with TextNode in Batik 1.6

Posted by Mathias Kalb <ma...@prodato.de>.
Thomas DeWeese wrote:

>> I use Batik 1.5.1 and now I am testing Batik 1.6.
>> I have a problem with the TextNode. I have a class which extends
>> "org.apache.batik.gvt.TextNode". This class calls
>> super.setAttributedCharacterIterator(...).
>> When I use Batik 1.5.1 I see this TextNode but with Batik 1.6 I do not
>> see it.
>>
>> Can anyone help?
> 
> 
>    Sorry, I can't think of anything that would directly cause
> this problem.  Can you give a little more information about
> what you are doing?  What sort of an ACI are you building
> (what properties do you set, etc)?

I found out that the problem is the method getPrimitiveBounds() in
the class TextNode. It contains:
primitiveBounds = textPainter.getBounds2D(this);

The value of "primitiveBounds" is null.
I create the AttributeCharacterIterator (aci) and maybe I have
to add something.

Thanks
Mathias Kalb

-- 
ProDatO Integration Technology GmbH
Hauptstrasse 60, 91054 Erlangen
http://www.prodato.de

Mathias Kalb, Dipl.-Inf. (FH)
mailto:mathias.kalb@prodato.de
fon: +49-9131-612877
fax: +49-9131-612881

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


Re: Problems with TextNode in Batik 1.6

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Mathias,

Mathias Kalb wrote:

> I use Batik 1.5.1 and now I am testing Batik 1.6.
> I have a problem with the TextNode. I have a class which extends
> "org.apache.batik.gvt.TextNode". This class calls
> super.setAttributedCharacterIterator(...).
> When I use Batik 1.5.1 I see this TextNode but with Batik 1.6 I do not
> see it.
> 
> Can anyone help?

    Sorry, I can't think of anything that would directly cause
this problem.  Can you give a little more information about
what you are doing?  What sort of an ACI are you building
(what properties do you set, etc)?

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