-
Bug
-
Resolution: Fixed
-
P3
-
6
-
mustang
-
x86
-
windows_xp
Name: rmT116609 Date: 08/23/2004
FULL PRODUCT VERSION :
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Windows XP
A DESCRIPTION OF THE PROBLEM :
The getGlyphCharIndex method in GlyphVector class returns wrong value
right after the GlyphVector is created. If you call the performDefaultLayout
method on the GlyphVector then the getGlyphCharIndex will return the right value. This used to work correctly under 1.4.2.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Here is a simple application to reproduce the error:
------------------------------------------------------------------------
import java.awt.Font;
import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;
import javax.swing.UIManager;
public class BetaBug
{
public static void main(String theParams[])
{
Font theFont = UIManager.getFont("Label.font");
String theFourScore =
"Four score and seven years ago our fathers brought forth on this continent a new nation, " +
"conceived in liberty and dedicated to the proposition that all men are created equal.";
GlyphVector theGV = theFont.createGlyphVector(new FontRenderContext(null, false, true), theFourScore);
System.out.println("A. Index 68: " + theGV.getGlyphCharIndex(68));
theGV.performDefaultLayout();
System.out.println("B. Index 68: " + theGV.getGlyphCharIndex(68));
}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Here are the correct results under 1.4.2.
----------------------------------------------------------------
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)
A. Index 68: 68
B. Index 68: 68
ACTUAL -
Here are the incorrect results under 1.5 beta 2
----------------------------------------------------------------
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)
A. Index 68: 106
B. Index 68: 68
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
If you call performDefaultLayout on the Glyph Vector then it works Correctly afterwards.
Release Regression From : 1.4.2_05
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Incident Review ID: 300555)
======================================================================