diff options
Diffstat (limited to 'src/ports/SkFontHost_mac.cpp')
-rwxr-xr-x | src/ports/SkFontHost_mac.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp index d7bd118d00..4f1c44dcdb 100755 --- a/src/ports/SkFontHost_mac.cpp +++ b/src/ports/SkFontHost_mac.cpp @@ -1832,8 +1832,21 @@ SkScalerContext* SkTypeface_Mac::onCreateScalerContext(const SkDescriptor* desc) } void SkTypeface_Mac::onFilterRec(SkScalerContextRec* rec) const { - unsigned flagsWeDontSupport = SkScalerContext::kDevKernText_Flag | - SkScalerContext::kAutohinting_Flag; + if (rec->fFlags & SkScalerContext::kLCD_BGROrder_Flag || + rec->fFlags & SkScalerContext::kLCD_Vertical_Flag) + { + rec->fMaskFormat = SkMask::kA8_Format; + // Render the glyphs as close as possible to what was requested. + // The above turns off subpixel rendering, but the user requested it. + // Normal hinting will cause the A8 masks to be generated from CoreGraphics subpixel masks. + // See comments below for more details. + rec->setHinting(SkPaint::kNormal_Hinting); + } + + unsigned flagsWeDontSupport = SkScalerContext::kDevKernText_Flag | + SkScalerContext::kAutohinting_Flag | + SkScalerContext::kLCD_BGROrder_Flag | + SkScalerContext::kLCD_Vertical_Flag; rec->fFlags &= ~flagsWeDontSupport; |