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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to