United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4654540 need hinting support for text rendering with scaled/flipped matrix
JDK-4654540 : need hinting support for text rendering with scaled/flipped matrix

Details
Type:
Bug
Submit Date:
2002-03-19
Status:
Resolved
Updated Date:
2006-03-22
Project Name:
JDK
Resolved Date:
2006-03-22
Component:
client-libs
OS:
generic
Sub-Component:
2d
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.2.2
Fixed Versions:

Related Reports
Relates:
Relates:
Relates:
Relates:

Sub Tasks

Description
need hinting support for text rendering with scaled/flipped matrix

                                    

Comments
EVALUATION

Truetype hinting is designed with assumption that orientation of glyph regarding pixel grid is fixed. I.e. it does not support complex affine transforms such as rotation or shear. It does work with scale transforms (if no flipping involved) 
and java2d supports that.

We may still benefit from hinting in case of complex transforms if we 
decompose them into scale transform S (that works with hinting engine) 
and another tranform T.
Then we can first apply hinting to outline with transform S and 
then apply transform T to already hinted outline.
This makes text outlook under different affine transforms more consistent
(turning off hinting makes the big difference).
                                     
2006-01-26
EVALUATION

Implemented following approach:
    a. decompose original transform to bitmap transform (combination
       of quadrant rotation and mirror) and remainder transform
    b. further decompose remainder transform to safe hinting transform
       and outline compensation transform
    c. perform hinting with safe transform
    d. apply compensation transform to hinted outline
    e. perform scan convertion
    f. apply bitmap transform

As a result of this we have following improvements:
    - quality of transformed text is significantly improved 
      if transfromation matrix is close to identity
      (e.g. for small rotations)
    - better consistency of the length of transformed text
    - fixed number of artefacts of assymetrical transforms (see also 4912220)
    - quadrant transforms/flips now produce symmetrical results

Note that quadrant rotations embeded into composite glyphs are handled 
without using bitmap transforms and for those glyphs some assymetry is 
still possible because of dropout control rules.

Also note that for some transforms quality will not improve and in some cases it may degrade. One example of this is rotations by large angles.

Some screenshots illustrating improvements and less obvious consequences are attached
to this bug report (sources of the actual tests are available from related bug reports).
                                     
2006-03-14



Hardware and Software, Engineered to Work Together