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-it.de> on 2004/02/24 10:18:23 UTC

Batik 1.5.1. TextAttribute STROKE

Hello,

I am using Batik 1.5 and I want to switch to Batik 1.5.1.

Unfortunately I can not compile my source code with the new
Batik-Jar-Files.

Two constants can not be found in the class:
"org.apache.batik.gvt.text.GVTAttributedCharacterIterator".

/** Stroke used to paint character outline.*/
public final static TextAttribute STROKE =
                             new TextAttribute("STROKE");

/** Paint used to stroke character outline */
public final static TextAttribute STROKE_PAINT =
                        new TextAttribute("STROKE_PAINT");


How can I solve this problem?

Thank you!
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@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: Batik 1.5.1. TextAttribute STROKE

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

> Thomas DeWeese wrote:
> 
>>    There is now one Class that contains all of the text rendering
>> properties (that don't effect layout):
>>
>>     org.apache.batik.gvt.text.TextPaintInfo
>>
>>    This one class is now associated with the ACI through the
>> TextAttribute 'GVTAttributedCharacterIterator.PAINT_INFO'.
>>
>>    This also replaces the use of java.awt.color.TextAttribute.FOREGROUND.
>>
> 
> Thank you! It works!
> 
> Is it right that only the following three attributes of TextPaintInfo
> are used in this version?

     Sure you should only use the under/over/through line stuff
if you want under/over/through lines.  Similarly if you didn't
want stroke/fill you should set them to null as well.

> During testing I found another problem.
> I created a java.awt.BasicStroke and set this object to the strokeStroke
> attribute of the TextPaintInfo. The width and the cap are okay, but the
> dash has a little problem.
> If I view a svg document with the adobe svg-viewer the start of the dash
> is different than in my program.

    Well the SVG specification is a little underspecified here.
In particular it is unclear what the behaviour should be in the
case of move to commands.  Does the dashing start over or
is it viewed as a continuation of the previous stroke? Also
there is no good 'closed form' solution for the length along
a bezier curve so this is always an approximation.  Which
means that over "long" paths small differences in how the
implementation does the length approximation can lead to
"large" differences in the dash locations.

    In general I don't know that you can count on perfect
reproduction of dashing - it is really intended as a 'line-style'
thing like for technical documents.  Unfortunately, I think
if you want 'exact' placement of dashes you will have to
expand them to paths.

> SVG document:
> <g stroke-dasharray="1, 1" stroke-dashoffset="0.0" ...>
>   <text ...>
>     ...
> 
> Program:
> float[] dash = new float[2];
> dash[0] = 1;
> dash[1] = 1;
> 
> float dash_phase = 0.0f;
> 
> tpi.strokeStroke = new BasicStroke(width, cap, join, miterlimit, dash[], 
> dash_phase);
> 
> Is this a known problem or is this my fault?
> 
> Adobe SVG Viewer 3.0
> Java 1.3.1
> Batik 1.5.1
> 
> Mathias Kalb
> 



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


Re: Batik 1.5.1. TextAttribute STROKE

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

>    There is now one Class that contains all of the text rendering
> properties (that don't effect layout):
> 
>     org.apache.batik.gvt.text.TextPaintInfo
> 
>    This one class is now associated with the ACI through the
> TextAttribute 'GVTAttributedCharacterIterator.PAINT_INFO'.
> 
>    This also replaces the use of java.awt.color.TextAttribute.FOREGROUND.
> 

Thank you! It works!

Is it right that only the following three attributes of TextPaintInfo
are used in this version?

public Paint     fillPaint;
public Paint     strokePaint;
public Stroke    strokeStroke;


During testing I found another problem.
I created a java.awt.BasicStroke and set this object to the strokeStroke
attribute of the TextPaintInfo. The width and the cap are okay, but the
dash has a little problem.
If I view a svg document with the adobe svg-viewer the start of the dash
is different than in my program.

SVG document:
<g stroke-dasharray="1, 1" stroke-dashoffset="0.0" ...>
   <text ...>
     ...

Program:
float[] dash = new float[2];
dash[0] = 1;
dash[1] = 1;

float dash_phase = 0.0f;

tpi.strokeStroke = new BasicStroke(width, cap, join, miterlimit, dash[], 
dash_phase);

Is this a known problem or is this my fault?

Adobe SVG Viewer 3.0
Java 1.3.1
Batik 1.5.1

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@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: AW: Pronounciation?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Michael Peregrin PREISEL wrote:

> Hello! My mother language is German and I know Batik as a technique for
> coloring clothes, which was often used by hippies in the Seventies. So I
> would say "bah teak", English spelled. In German Batik is just
> pronounced "Batik", same as you read it. But is this that essentially?

    Yes, this refers to the textile art form:

http://xml.apache.org/batik/faqs.html#faq-15

    And while I am not an expert I pronounce it 'bah teak'
(emphasis on 'bah').


> 
> Ciao, Peregrin.
> 
> -----Ursprüngliche Nachricht-----
> Von: Bob Carpenter [mailto:bobc@engineer.com] 
> Gesendet: Mittwoch, 25. Februar 2004 01:45
> An: Batik Users
> Betreff: Pronounciation?
> 
> 
> Is it pronounced "bah teak" or "bay tick" or something else?
> 
> Thanks,
> 
> --BobC
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 



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


AW: Pronounciation?

Posted by Michael Peregrin PREISEL <pe...@gmx.at>.
Hello! My mother language is German and I know Batik as a technique for
coloring clothes, which was often used by hippies in the Seventies. So I
would say "bah teak", English spelled. In German Batik is just
pronounced "Batik", same as you read it. But is this that essentially?

Ciao, Peregrin.

-----Ursprüngliche Nachricht-----
Von: Bob Carpenter [mailto:bobc@engineer.com] 
Gesendet: Mittwoch, 25. Februar 2004 01:45
An: Batik Users
Betreff: Pronounciation?


Is it pronounced "bah teak" or "bay tick" or something else?

Thanks,

--BobC


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




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


Pronounciation?

Posted by Bob Carpenter <bo...@engineer.com>.
Is it pronounced "bah teak" or "bay tick" or something else?

Thanks,

--BobC


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


Re: Batik 1.5.1. TextAttribute STROKE

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

> I am using Batik 1.5 and I want to switch to Batik 1.5.1.
> 
> Unfortunately I can not compile my source code with the new
> Batik-Jar-Files.
> 
> Two constants can not be found in the class:
> "org.apache.batik.gvt.text.GVTAttributedCharacterIterator".
> 
> /** Stroke used to paint character outline.*/
> public final static TextAttribute STROKE =
>                             new TextAttribute("STROKE");
> 
> /** Paint used to stroke character outline */
> public final static TextAttribute STROKE_PAINT =
>                        new TextAttribute("STROKE_PAINT");
> 
> 
> How can I solve this problem?

    There is now one Class that contains all of the text rendering
properties (that don't effect layout):

     org.apache.batik.gvt.text.TextPaintInfo

    This one class is now associated with the ACI through the
TextAttribute 'GVTAttributedCharacterIterator.PAINT_INFO'.

    This also replaces the use of java.awt.color.TextAttribute.FOREGROUND.

    The upside of these changes is that modifying the properties
in the TPI (TextPainterInfo) no longer requires a 'relayout' of the
text it simply repaint's the effected area.  If you do change the
TPI contents directly, then you need to make sure you call:

batik.gvt.TextNode.SwapTextPaintInfo
	(TextPaintInfo new, TextPaintInfo old);




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