[FreeType] Always use MONO hinting when hinting in monochrome.
This matches the behaviour of Cairo. It appears to be an undocumented trick of font rendering on Linux that, in monochrome, all the hinting modes expect no-hinting are mapped to FreeType's MONO hinting. http://code.google.com/p/chromium/issues/detail?id=43252 http://codereview.appspot.com/1162041/show git-svn-id: http://skia.googlecode.com/svn/trunk@562 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
652807bbc8
commit
70a303f3c9
@ -356,6 +356,12 @@ SkScalerContext_FreeType::SkScalerContext_FreeType(const SkDescriptor* desc)
|
||||
{
|
||||
FT_Int32 loadFlags = FT_LOAD_DEFAULT;
|
||||
|
||||
if (SkMask::kBW_Format == fRec.fMaskFormat) {
|
||||
// See http://code.google.com/p/chromium/issues/detail?id=43252#c24
|
||||
loadFlags = FT_LOAD_TARGET_MONO;
|
||||
if (fRec.getHinting() == SkPaint::kNo_Hinting)
|
||||
loadFlags = FT_LOAD_NO_HINTING;
|
||||
} else {
|
||||
switch (fRec.getHinting()) {
|
||||
case SkPaint::kNo_Hinting:
|
||||
loadFlags = FT_LOAD_NO_HINTING;
|
||||
@ -377,6 +383,7 @@ SkScalerContext_FreeType::SkScalerContext_FreeType(const SkDescriptor* desc)
|
||||
SkDebugf("---------- UNKNOWN hinting %d\n", fRec.getHinting());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((fRec.fFlags & SkScalerContext::kEmbeddedBitmapText_Flag) == 0)
|
||||
loadFlags |= FT_LOAD_NO_BITMAP;
|
||||
|
Loading…
Reference in New Issue
Block a user