JDK-6896857 : t2k should setup gridfitting environment only when needed
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2009-10-30
  • Updated: 2013-11-01
  • Resolved: 2009-12-22
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.
6u18Fixed 7 b77Fixed
Related Reports
Relates :  
Relates :  
Start of minimal FX app generated by Netbeans (with signle text String) causes 200 calls to TrueTypeFont.readBlock() on Windows.

Further analysis shows that most of the blocks are read from 

One of the major contributoros seems to be initialization of TextLayout that requests font metrics for the logical font.
Apparently this casues setupT2K() to be called that always setups grid fitting environment. As part of 
setup of grid fitting environemnt global hints are computed and this cause some glyphs to be read from 
different parts of the font file.

This initialization is done once but if font is not actually used to draw any glyphs (and this is the case 
for some of physical fonts composing logical font) then this is uneeded work.

EVALUATION Together with fix for 6753173 the savings in amount of data we read from ttf files are (for 2 minimal FX apps) notext: 45260 -> 7980 text: 525235 -> 315806 (without fix -> with fix, in bytes, using recent fx sdk)

EVALUATION Avoiding grid fitting environment setup for getFontMetrics() reduces number of readBlock() calls from 200 to about 100. This likely needs to be done for outline processing methods too. Moreover, it is not clear whether we actually use global hints at all. With autohinting and disabled why do we need autogridfitting and global hints? Need to investigate.