Details
-
Bug
-
Status: Resolved
-
Resolution: Fixed
-
1.6
-
None
-
None
-
Operating System: Windows XP
Platform: Other
Description
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