From 5d80f903cfe1a9f60b5eb4237dcf2496dc9feaf8 Mon Sep 17 00:00:00 2001 From: "caryclark@google.com" Date: Tue, 20 Dec 2011 20:06:37 +0000 Subject: [PATCH] fix vertical text on Lion M src/ports/SkFontHost_mac_coretext.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@2906 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/ports/SkFontHost_mac_coretext.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ports/SkFontHost_mac_coretext.cpp b/src/ports/SkFontHost_mac_coretext.cpp index 423f0af..4c322bc 100644 --- a/src/ports/SkFontHost_mac_coretext.cpp +++ b/src/ports/SkFontHost_mac_coretext.cpp @@ -667,6 +667,7 @@ SkScalerContext_Mac::SkScalerContext_Mac(const SkDescriptor* desc) } else { fVerticalMatrix.preRotate(SkIntToScalar(90)); } + fVerticalMatrix.postScale(SK_Scalar1, -SK_Scalar1); } fGlyphCount = SkToU16(numGlyphs); fDoSubPosition = SkToBool(fRec.fFlags & kSubpixelPositioning_Flag); @@ -791,8 +792,13 @@ void SkScalerContext_Mac::getVerticalOffset(CGGlyph glyphID, SkIPoint* offset) c SkFloatToScalar(vertOffset.height)}; SkPoint floatOffset; fVerticalMatrix.mapPoints(&floatOffset, &trans, 1); + if (isLion()) { + // Lion changed functionality from Snow Leopard, though it's not clear why + // this is required here; it was found through trial and error. + fUnitMatrix.mapPoints(&floatOffset, 1); + } offset->fX = SkScalarRound(floatOffset.fX); - offset->fY = -SkScalarRound(floatOffset.fY); + offset->fY = SkScalarRound(floatOffset.fY); } /* from http://developer.apple.com/fonts/TTRefMan/RM06/Chap6loca.html -- 2.7.4