aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
diff options
context:
space:
mode:
authorGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-28 19:47:43 +0000
committerGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-28 19:47:43 +0000
commit8b6d6286b6caf3b72ad639d9c721f3afdb3cc936 (patch)
tree156ad70c3165c907c8183ba1a599a698bc8ce99e /src/ports
parent3961aac79ef9e9d20f279e4757fde730eff21f39 (diff)
Normalize font BBox to make sure it's correct when rendering a PDF on the mac.
Original CL by abodenha@chromium.org: https://codereview.appspot.com/6501049/ BUG=crbug.com/124572 Review URL: https://codereview.appspot.com/6492048 git-svn-id: http://skia.googlecode.com/svn/trunk@5325 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/ports')
-rw-r--r--src/ports/SkFontHost_mac_coretext.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ports/SkFontHost_mac_coretext.cpp b/src/ports/SkFontHost_mac_coretext.cpp
index d6a2543788..21fb2ed5cb 100644
--- a/src/ports/SkFontHost_mac_coretext.cpp
+++ b/src/ports/SkFontHost_mac_coretext.cpp
@@ -1609,8 +1609,11 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
info->fDescent = (int16_t) CTFontGetDescent(ctFont);
info->fCapHeight = (int16_t) CTFontGetCapHeight(ctFont);
CGRect bbox = CTFontGetBoundingBox(ctFont);
- info->fBBox = SkIRect::MakeXYWH((int16_t) bbox.origin.x, (int16_t) bbox.origin.y,
- (int16_t) bbox.size.width, (int16_t) bbox.size.height);
+ info->fBBox = SkIRect::MakeLTRB(
+ CGToScalar(CGRectGetMinX_inline(bbox)), // Left
+ CGToScalar(CGRectGetMaxY_inline(bbox)), // Top
+ CGToScalar(CGRectGetMaxX_inline(bbox)), // Right
+ CGToScalar(CGRectGetMinY_inline(bbox))); // Bottom
// Figure out a good guess for StemV - Min width of i, I, !, 1.
// This probably isn't very good with an italic font.