Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1412)

Unified Diff: Source/platform/fonts/win/FontCacheSkiaWin.cpp

Issue 213673011: [DirectWrite] Force full hinting for certain fonts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/win/FontCacheSkiaWin.cpp
diff --git a/Source/platform/fonts/win/FontCacheSkiaWin.cpp b/Source/platform/fonts/win/FontCacheSkiaWin.cpp
index 5802e0d5bb2386d18569b3e61b602cc141c0b959..4893207f29e6e8e5d4bcbbe55c692c39a97416c2 100644
--- a/Source/platform/fonts/win/FontCacheSkiaWin.cpp
+++ b/Source/platform/fonts/win/FontCacheSkiaWin.cpp
@@ -221,6 +221,15 @@ static unsigned minSizeForAntiAlias(UScriptCode script)
}
}
+static bool fontRequiresFullHinting(const AtomicString& familyName)
+{
+ DEFINE_STATIC_LOCAL(AtomicString, courierNew, ("Courier New", AtomicString::ConstructFromLiteral));
+ if (equalIgnoringCase(familyName, courierNew))
Stephen White 2014/05/28 13:12:52 BTW, it looks from the code like a case-insensitiv
+ return true;
+
+ return false;
+}
+
FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, float fontSize)
{
CString name;
@@ -245,9 +254,13 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
fontDescription.orientation(),
s_useSubpixelPositioning);
+ // FIXME: It might be sufficient to set the "full hinting" flag for
+ // CJK instead of forcing aliased rendering.
if (s_useDirectWrite) {
result->setMinSizeForAntiAlias(
minSizeForAntiAlias(fontDescription.script()));
+ if (fontRequiresFullHinting(family))
+ result->setHinting(SkPaint::kFull_Hinting);
}
return result;
« no previous file with comments | « Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698