-
Bug
-
Resolution: Fixed
-
P2
-
OpenJDK6
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2164891 | OpenJDK6 | Igor Nekrestyanov | P2 | Resolved | Fixed | b12 |
The following code throws exception with hershey font that can be found in recent
fedora release:
Font f = Font.createFont(Font.TYPE1_FONT, new File("hrger.pfa"));
FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(f);
fm.getWidths(); //Index out of bounds is thrown here.
Exception stack trace:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at sun.font.FileFontStrike.setCachedGlyphPtr(FileFontStrike.java:374)
at sun.font.FileFontStrike.setCachedGlyphPtr(FileFontStrike.java:425)
at sun.font.FileFontStrike.getGlyphImagePtr(FileFontStrike.java:284)
at sun.font.FileFontStrike.getGlyphAdvance(FileFontStrike.java:496)
at sun.font.FileFontStrike.getCodePointAdvance(FileFontStrike.java:526)
at sun.font.FontDesignMetrics.handleCharWidth(FontDesignMetrics.java:415)
at sun.font.FontDesignMetrics.getWidths(FontDesignMetrics.java:537)
at HersheyFont.main(HersheyFont.java:27)
Test source code and font file are attached to this CR.
This can be reproduced on openjdk 6 "build 1.6.0-ea-b10" on at least
solaris x86 and linux.
on jdk 7 the test code above runs successfully on both solaris and linux.
fedora release:
Font f = Font.createFont(Font.TYPE1_FONT, new File("hrger.pfa"));
FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(f);
fm.getWidths(); //Index out of bounds is thrown here.
Exception stack trace:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at sun.font.FileFontStrike.setCachedGlyphPtr(FileFontStrike.java:374)
at sun.font.FileFontStrike.setCachedGlyphPtr(FileFontStrike.java:425)
at sun.font.FileFontStrike.getGlyphImagePtr(FileFontStrike.java:284)
at sun.font.FileFontStrike.getGlyphAdvance(FileFontStrike.java:496)
at sun.font.FileFontStrike.getCodePointAdvance(FileFontStrike.java:526)
at sun.font.FontDesignMetrics.handleCharWidth(FontDesignMetrics.java:415)
at sun.font.FontDesignMetrics.getWidths(FontDesignMetrics.java:537)
at HersheyFont.main(HersheyFont.java:27)
Test source code and font file are attached to this CR.
This can be reproduced on openjdk 6 "build 1.6.0-ea-b10" on at least
solaris x86 and linux.
on jdk 7 the test code above runs successfully on both solaris and linux.
- backported by
-
JDK-2164891 IOB exception when getting font metrics of hershey font
-
- Resolved
-
- relates to
-
JDK-6609143 wasn't able to create type 1 font under windows
-
- Closed
-