Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4755212
Votes 0
Synopsis Java2D rasteriser has problems with some TT fonts.
Category java:classes_2d
Reported Against 1.4
Release Fixed 1.4.1_03
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs 4482430
Submit Date 29-SEP-2002
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.
Work Around
N/A
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.

 xxxxx@xxxxx  2002-09-29
============================
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang