Why do you even create and calculate temporary shoot_delta? You can explicitly increment/decrement blue->shoot.fit the same way you do blue->ref.fit. Like this:
+ AF_CJKBlue blue; + + if ( delta_t >= delta_b ) + { + blue = &axis->blues[AF_CJK_BLUE_TOP]; + blue->ref.fit += 64; + blue->shoot.fit += 64; + } + else + { + blue = &axis->blues[AF_CJK_BLUE_BOTTOM]; + blue->ref.fit -= 64; + blue->shoot -= 64; + } On Fri, May 13, 2011 at 7:37 AM, Just Fill Bugs <mozbug...@yahoo.com.au> wrote: > 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. > > > _______________________________________________ > Freetype-devel mailing list > Freetype-devel@nongnu.org > https://lists.nongnu.org/mailman/listinfo/freetype-devel > > -- Alexei A. Podtelezhnikov, PhD _______________________________________________ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel