You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Bill Haneman <Bi...@ireland.sun.com> on 2001/01/05 18:25:11 UTC

Re: [commit] new TextSpanLayout

Hi:

By the way,

if anyone wants to actually *try out* the new
text layout implementation, you can do it by 
changing the following lines in 
org.apache.batik.refimpl.gvt.text.ConcreteTextLayoutFactory.java:

 Set keys = aci.getAllAttributeKeys();
 Set glyphPositionKeys = new HashSet();
 glyphPositionKeys.add(
     GVTAttributedCharacterIterator.TextAttribute.X);
 glyphPositionKeys.add(
     GVTAttributedCharacterIterator.TextAttribute.Y);
 glyphPositionKeys.add(
     GVTAttributedCharacterIterator.TextAttribute.ROTATION);
 glyphPositionKeys.retainAll(keys);
 if (glyphPositionKeys.isEmpty()) {
     return new TextLayoutAdapter(new TextLayout(aci, frc), aci);
 } else {
     return new GlyphLayout(aci, frc);
 }

(change: remove the if/else and always return GlyphLayout).

The only regressions that I saw when always using
GlyphLayout rather than TextLayoutAdapter were in textBiDi.svg,
but that example is important enough that I 
put the above branch in place.  I don't think that
we have an efficient way, at the moment, of determining
whether a text element contains non-LTR text or not,
but that would be a better test than checking for
glyph layout attributes.  I will investigate this further.

-Bill

-----
Bill Haneman x19279
Ireland Desktop Engineering
Sun Microsystems Ireland Ltd.