United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7124223 [macosx] Regression test failure with new exception, when glyph is positioned explicitly
JDK-7124223 : [macosx] Regression test failure with new exception, when glyph is positioned explicitly

Details
Type:
Bug
Submit Date:
2011-12-23
Status:
Closed
Updated Date:
2012-09-25
Project Name:
JDK
Resolved Date:
2012-02-29
Component:
client-libs
OS:
os_x
Sub-Component:
2d
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
7u4 (b13)

Related Reports
Backport:
Duplicate:

Sub Tasks

Description
http://java.net/jira/browse/MACOSX_PORT-754 submitted 2011/11/29 by Yuri Nesterenko
This closed test used to fail in b218 reporting that explicitly set position not used. In b219, however, it is a consistent ArrayIndexOutOfBoundsException: -2. Looks like it may be useful to mention it now.
I'm attaching the test here.
Build: b219
closed/java/awt/print/PrinterJob/GlyphPositions.java

                                    

Comments
SUGGESTED FIX

http://cr.openjdk.java.net/~bae/7124223/webrev/
http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/b3d6b8a43aca
                                     
2012-02-15
EVALUATION

Note that PathGrapics uses a glyph codes as a indexes in an array
 in order to provide a mapping from glyph codes back to unicode
 characters. So, it assumes that glyph code is not negative.

 However it is not true in case of macosx: if there is no glyph
 in a font for some character, then macosx font support machinery
 returns negative unicode char in order to indicate that this char
 requires a substitution (CoreTextSupport.m, lines 92 - 126).

 Suggested fix just ignores negative glyph codes in PathGrapics.

 See also comments section.
                                     
2012-02-15



Hardware and Software, Engineered to Work Together