[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] [Patch] Compensate blue zone rounding after scale
From: |
Just Fill Bugs |
Subject: |
[ft-devel] [Patch] Compensate blue zone rounding after scale |
Date: |
Fri, 13 May 2011 19:37:40 +0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110422 Shredder/3.1.11pre |
In af_cjk_metrics_scale_dim(), when we scale the blue zone to the font
size, the blue zone is also rounded to pixel grid. The offset introduced
in the rounding at both the bottom and top could have undesirable effect
on the glyph height at certain font size.
There are 4 states for the sum of top and bottom fit offset:
1. top + bottom >= 1.5 px Round to 2 px
2. top + bottom >= 1.0 px Round to 1 px
Bad Case: 0.5 + 0.5 => 1 + 1 = 2px > 1px
3. top + bottom >= 0.5 px Round to 1 px
Bad Case: 0.4 + 0.4 => 0 + 0 = 0px < 1px
4. top + bottom < 0.5 px Round to 0 px
For the 2 bad results:
1st bad is OK, since we are OK with a pixel increase in size at small
font size.
2nd bad is not OK. It shrink our already limited space by 1px at small
font size. So we should compensate 1px in that situation.
The patch only tried to fix the ref blue zone.
The compensation kicked in at 11.5pt and 10pt and add 1px to the glyph
height for wqy-zenhei.ttc.
cjk-bluezone-compensate-scale.patch
Description: Text Data
- [ft-devel] [Patch] Compensate blue zone rounding after scale,
Just Fill Bugs <=