United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6896857 t2k should setup gridfitting environment only when needed
6896857 : t2k should setup gridfitting environment only when needed

Details
Type:
Bug
Submit Date:
2009-10-30
Status:
Closed
Updated Date:
2010-07-09
Project Name:
JDK
Resolved Date:
2009-12-22
Component:
client-libs
OS:
generic
Sub-Component:
2d
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
7

Related Reports
Backport:
Relates:
Relates:

Sub Tasks

Description
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 
  arial.ttf
  wingding.ttf
  symbol.ttf
  LucidaSansRegular.ttf

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.

                                    

Comments
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)
                                     
2009-11-04
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.
                                     
2009-10-30



Hardware and Software, Engineered to Work Together