JDK-4755212 : Java2D rasteriser has problems with some TT fonts.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2002-09-29
  • Updated: 2003-03-19
  • Resolved: 2002-10-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other
1.4.1_03 03Fixed 1.4.2Fixed
Related Reports
Relates :  
Description
This is one of the causes of bug 
4482430: Unexpected exception from NativeFontWrapper.registerFonts
Two fonts have been identified which each have a pair of problems, which
appear unrelated but either or both can cause a crash.

The fonts have
a) some glyphs with zero or incomplete contours
b) an hmtx table which has more entries than there are glyphs in the font.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.4.1_03 mantis FIXED IN: 1.4.1_03 mantis INTEGRATED IN: 1.4.1_03 mantis mantis-b04
14-06-2004

EVALUATION 1. These fonts appear to have some glyphs with zero or incomplete contours. The T2k implementation with asserts enabled will trigger an assert on countourCount ==0 in New_GlyphClass(..) If asserts are turned off it will SEGV by deferencing a pointer that hasn't been allocated. Also if contourCount > 0 but there is only 1 contour and it says that the final endpoint is point 0 (ep[0]=0, so stmp == 1) then we don't have a valid contour The fix is - initialise to null some fields that should have been but weren't - in the event zero contours return NULL from New_GlyphClass() - in the event of the only contour having only 1 pt also return NULL - make the caller return an empty glyph instead of asserting on a NULL return. 2. The code in New_hmtxClass and *New_hmtxEmptyClass in truetype.c allocates arrays of length numGlyphs, but then reads into this array numberOfHMetrics entries. The latter figure is obtained from the hhea table. Normally this is OK since numberOfHMetrics is normally not greater than numberOfHMetrics but in these fonts it is. This causes random crashes. There are supposed to be at least numberOfHMetrics entries, but if that value is < numGlyphs its becasue the rest is supposedly an array of LSB. So the fix is that if numberOfHMetrics > numGlyphs allocate an array big enough to hold it even if we aren't exactly sure where that extra data is used. ###@###.### 2002-09-29 ============================
29-09-2002