diff options
author | 2011-12-20 20:06:37 +0000 | |
---|---|---|
committer | 2011-12-20 20:06:37 +0000 | |
commit | 5d80f903cfe1a9f60b5eb4237dcf2496dc9feaf8 (patch) | |
tree | a7f91929b38f2571f828dc435781762d7f0c7d6b /src/ports | |
parent | ae814c74763e3f7c13aeb03f6f8b894bd11ff35e (diff) |
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
Diffstat (limited to 'src/ports')
-rw-r--r-- | src/ports/SkFontHost_mac_coretext.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ports/SkFontHost_mac_coretext.cpp b/src/ports/SkFontHost_mac_coretext.cpp index 423f0af98c..4c322bc522 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 |