diff options
author | ctguil@chromium.org <ctguil@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-08 23:23:20 +0000 |
---|---|---|
committer | ctguil@chromium.org <ctguil@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-08 23:23:20 +0000 |
commit | 66f2e33651888efe47537c563ca846b029e7001d (patch) | |
tree | c8a2088e09a4c91eee97a4cc5c33e654530829eb | |
parent | 04c643b7739cf7e618d9996c3fd1514eee4b27c0 (diff) |
Port change r2040 to mac
This is to honor fixed width font during PDF generation. Change r2040 fixed only Windows port. Linux does not have the problem.
Review URL: http://codereview.appspot.com/4855046
git-svn-id: http://skia.googlecode.com/svn/trunk@2076 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/ports/SkFontHost_mac_coretext.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ports/SkFontHost_mac_coretext.cpp b/src/ports/SkFontHost_mac_coretext.cpp index 5b04f0208a..3bb90f7a6e 100644 --- a/src/ports/SkFontHost_mac_coretext.cpp +++ b/src/ports/SkFontHost_mac_coretext.cpp @@ -820,8 +820,15 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics( info->fType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font; } else if (perGlyphInfo & SkAdvancedTypefaceMetrics::kHAdvance_PerGlyphInfo) { - info->fGlyphWidths.reset( - getAdvanceData(ctFont, glyphCount, &getWidthAdvance)); + if (info->fStyle & SkAdvancedTypefaceMetrics::kFixedPitch_Style) { + appendRange(&info->fGlyphWidths, 0); + info->fGlyphWidths->fAdvance.append(1, &min_width); + finishRange(info->fGlyphWidths.get(), 0, + SkAdvancedTypefaceMetrics::WidthRange::kDefault); + } else { + info->fGlyphWidths.reset( + getAdvanceData(ctFont, glyphCount, &getWidthAdvance)); + } } CFSafeRelease(ctFont); |