Bug 38158

Summary: Bug with lower case special characters
Product: Batik - Now in Jira Reporter: Tiago <stutzinho>
Component: GVT TextAssignee: Batik Developer's Mailing list <batik-dev>
Status: RESOLVED FIXED    
Severity: critical    
Priority: P2    
Version: 1.6   
Target Milestone: ---   
Hardware: Other   
OS: Windows XP   

Description Tiago 2006-01-06 08:28:37 UTC
Greetings...

First of all, i would like to make clear that this problem DOESN'T occur with
UPPERCASE LETTERS.
I noticed a bug when displaying some special characters (á, é, í, ê...) when
they are in lower case (I used both JSVGCanvas and Squiggle - batik's browser).
The bug is: if these characters are at the beginning of the line, i.e., if they
are the first letter of the line, everthing works fine, but if these characters
are the second character or greater, the following error occurs:

java.lang.ArrayIndexOutOfBoundsException: 23
	at org.apache.batik.gvt.flow.TextLineBreaks.findLineBrk(Unknown Source)
	at
org.apache.batik.bridge.svg12.SVGFlowRootElementBridge.buildAttributedString(Unknown
Source)
	at org.apache.batik.bridge.SVGTextElementBridge.computeLaidoutText(Unknown Source)
	at
org.apache.batik.bridge.svg12.SVGFlowRootElementBridge.computeLaidoutText(Unknown
Source)
	at org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
	at org.apache.batik.swing.svg.GVTTreeBuilder.run(Unknown Source)


The characters I noticed that had problems are:
á, é, í, ó, ú, ê, à, ü

The others that I tested and worked fine are:
ã, õ, â, ô and ALL characters in uppercase

==== To illustrate the situation I made some tests. 
     The text that CAUSES ERROR is:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<svg
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   version="1.2"
   width="450"
   height="500"  
   id="body">
  <defs id="defs16" />
  <g
     id="content">
    <flowRoot style="font-size:20px" id="flowRoot6">
      <flowRegion id="flowRegion8">
        <rect width="780" height="580" x="10" y="10" id="rect10" />
      </flowRegion>
      <flowDiv id="flowDiv12">
        <flowPara id="bug-test" style="font-family:Courier New">
		Dávio
	  </flowPara>
      </flowDiv>
    </flowRoot>
  </g>
</svg>



The text that WORKS FINE is:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<svg
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   version="1.2"
   width="450"
   height="500"  
   id="body">
  <defs id="defs16" />
  <g
     id="content">
    <flowRoot style="font-size:20px" id="flowRoot6">
      <flowRegion id="flowRegion8">
        <rect width="780" height="580" x="10" y="10" id="rect10" />
      </flowRegion>
      <flowDiv id="flowDiv12">
        <flowPara id="bug-test" style="font-family:Courier New">
		ávio
	  </flowPara>
      </flowDiv>
    </flowRoot>
  </g>
</svg>

Some other tests can be made by replacing the text inside the "flowPara" tag by
words like "éveni", "féveo", "toeõãâu", "sÀÉop", ...


Well, that's it... I hope you don't have problems understanding the explanation
as well as fixing the bug...

Thanks in advance!

 Bye!

Tiago de Oliveira Stutz
Comment 1 Thomas Deweese 2006-01-09 13:10:14 UTC
This should be fixed in SVN now (trunk and svg11).
Comment 2 Tiago 2006-01-09 16:15:20 UTC
(In reply to comment #1)
> This should be fixed in SVN now (trunk and svg11).


Oh right!! Thanks in advance for your help!!