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

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

Issue 544843004: [DirectWrite] Disable subpixel font positioning for old fonts (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase w/HEAD Created 6 years, 3 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
Index: Source/platform/fonts/win/FontCacheSkiaWin.cpp
diff --git a/Source/platform/fonts/win/FontCacheSkiaWin.cpp b/Source/platform/fonts/win/FontCacheSkiaWin.cpp
index 1d2f3e853d0018002db197a344e6e6c50d7fdabd..ae763bc79e00cb1b7d607e83207e4f734d12dcb0 100644
--- a/Source/platform/fonts/win/FontCacheSkiaWin.cpp
+++ b/Source/platform/fonts/win/FontCacheSkiaWin.cpp
@@ -248,6 +248,33 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
}
}
+ // List of fonts that look bad with subpixel text rendering at smaller font
+ // sizes. This includes all fonts in the Microsoft Core fonts for the Web
+ // collection.
+ const static wchar_t* noSubpixelForSmallSizeFont[] = {
scottmg 2014/09/05 16:55:41 nit; sort this list
+ L"arial",
+ L"courier new",
+ L"times new roman",
+ L"andale mono",
+ L"comic sans",
+ L"impact",
+ L"georgia",
+ L"trebuchet",
scottmg 2014/09/05 16:55:41 does this need to be "trebuchet ms"?
+ L"verdana",
+ L"webdings",
+ L"tahoma",
+ L"lucida console"
+ };
+ const static float minSizeForSubpixelForFont = 16.0f;
+ numFonts = WTF_ARRAY_LENGTH(noSubpixelForSmallSizeFont);
+ for (size_t i = 0; i < numFonts; i++) {
+ const wchar_t* family = noSubpixelForSmallSizeFont[i];
+ if (typefacesMatchesFamily(tf.get(), family)) {
+ result->setMinSizeForSubpixel(minSizeForSubpixelForFont);
+ break;
+ }
+ }
+
return result;
}
« no previous file with comments | « Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.cpp ('k') | Source/platform/fonts/win/FontPlatformDataWin.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698