diff options
author | agl@chromium.org <agl@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-07-21 18:05:59 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-07-21 18:05:59 +0000 |
commit | 1a18cdc85f172139ea20ac116969e954a8df786e (patch) | |
tree | ec04e69c99725393c72aedee8a4785e4d5487046 | |
parent | 2db1177fd57e984e265055485a9ca14075c90975 (diff) |
Mac: fix SkFontHost_mac.cpp to work with the new hinting interface.
git-svn-id: http://skia.googlecode.com/svn/trunk@277 2bbb7eff-a529-9590-31e7-b0007b416f81
-rwxr-xr-x | src/ports/SkFontHost_mac.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp index 5deae35491..c807be74b9 100755 --- a/src/ports/SkFontHost_mac.cpp +++ b/src/ports/SkFontHost_mac.cpp @@ -18,6 +18,7 @@ #include "SkFontHost.h" #include "SkDescriptor.h" #include "SkEndian.h" +#include "SkPaint.h" #include "SkPoint.h" // Give 1MB font cache budget @@ -125,15 +126,13 @@ SkScalerContext_Mac::SkScalerContext_Mac(const SkDescriptor* desc) SkScalarToFloat(m[SkMatrix::kMTransY])); ATSStyleRenderingOptions renderOpts = kATSStyleApplyAntiAliasing; - switch (fRec.fHints) { - case kNo_Hints: + switch (fRec.getHinting()) { + case SkPaint::kNo_Hinting: + case SkPaint::kSlight_Hinting: renderOpts |= kATSStyleNoHinting; break; - case kSubpixel_Hints: - // hmmm, need to support subpixel... from path? - renderOpts |= kATSStyleNoHinting; - break; - case kNormal_Hints: + case SkPaint::kNormal_Hinting: + case SkPaint::kFull_Hinting: renderOpts |= kATSStyleApplyHints; break; } @@ -229,8 +228,8 @@ void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) { set_glyph_metrics_on_error(glyph); return; } - - if (kNormal_Hints == fRec.fHints) { + + if (!fRec.fSubpixelPositioning) { glyph->fAdvanceX = SkFloatToFixed(screenMetrics.deviceAdvance.x); glyph->fAdvanceY = -SkFloatToFixed(screenMetrics.deviceAdvance.y); } else { |