diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-09-02 20:08:11 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-09-02 20:08:11 +0000 |
commit | f8cead5e08fe3298ba09da5a15c2d835747c567d (patch) | |
tree | 6a0c330fdfa0657025414f8dac6eeb9526df34a3 | |
parent | 973b879dfd994fdb2d5d487edc2012ee3a81f326 (diff) |
outset 2 on all sides, as we now find some CJK fonts that are off by
that amount when we compare the bounds returned by GetGlyphOutline and what
GDI actually draws.
git-svn-id: http://skia.googlecode.com/svn/trunk@2214 2bbb7eff-a529-9590-31e7-b0007b416f81
-rwxr-xr-x | src/ports/SkFontHost_win.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp index 4a091bc71b..c5a9e08c59 100755 --- a/src/ports/SkFontHost_win.cpp +++ b/src/ports/SkFontHost_win.cpp @@ -462,14 +462,20 @@ void SkScalerContext_Windows::generateMetrics(SkGlyph* glyph) { glyph->fAdvanceX = SkIntToFixed(gm.gmCellIncX); glyph->fAdvanceY = -SkIntToFixed(gm.gmCellIncY); - // we outset by 1 in all dimensions, since the image may bleed outside + // we outset in all dimensions, since the image may bleed outside // of the computed bounds returned by GetGlyphOutline. // This was deduced by trial and error for small text (e.g. 8pt), so there // maybe a more precise way to make this adjustment... - glyph->fWidth += 2; - glyph->fHeight += 2; - glyph->fTop -= 1; - glyph->fLeft -= 1; + // + // This test shows us clipping the tops of some of the CJK fonts unless we + // increase the top of the box by 2, hence the height by 4. This seems to + // correspond to an embedded bitmap font, but not sure. + // LayoutTests/fast/text/backslash-to-yen-sign-euc.html + // + glyph->fWidth += 4; + glyph->fHeight += 4; + glyph->fTop -= 2; + glyph->fLeft -= 2; if (fHiResFont) { SelectObject(fDDC, fHiResFont); |