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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Computer, Inc. 2 * Copyright (C) 2006, 2007 Apple Computer, Inc.
3 * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. 3 * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 }; 241 };
242 size_t numFonts = WTF_ARRAY_LENGTH(minAntiAliasSizeForFont); 242 size_t numFonts = WTF_ARRAY_LENGTH(minAntiAliasSizeForFont);
243 for (size_t i = 0; i < numFonts; i++) { 243 for (size_t i = 0; i < numFonts; i++) {
244 FamilyMinSize entry = minAntiAliasSizeForFont[i]; 244 FamilyMinSize entry = minAntiAliasSizeForFont[i];
245 if (typefacesMatchesFamily(tf.get(), entry.family)) { 245 if (typefacesMatchesFamily(tf.get(), entry.family)) {
246 result->setMinSizeForAntiAlias(entry.minSize); 246 result->setMinSizeForAntiAlias(entry.minSize);
247 break; 247 break;
248 } 248 }
249 } 249 }
250 250
251 // List of fonts that look bad with subpixel text rendering at smaller font
252 // sizes. This includes all fonts in the Microsoft Core fonts for the Web
253 // collection.
254 const static wchar_t* noSubpixelForSmallSizeFont[] = {
scottmg 2014/09/05 16:55:41 nit; sort this list
255 L"arial",
256 L"courier new",
257 L"times new roman",
258 L"andale mono",
259 L"comic sans",
260 L"impact",
261 L"georgia",
262 L"trebuchet",
scottmg 2014/09/05 16:55:41 does this need to be "trebuchet ms"?
263 L"verdana",
264 L"webdings",
265 L"tahoma",
266 L"lucida console"
267 };
268 const static float minSizeForSubpixelForFont = 16.0f;
269 numFonts = WTF_ARRAY_LENGTH(noSubpixelForSmallSizeFont);
270 for (size_t i = 0; i < numFonts; i++) {
271 const wchar_t* family = noSubpixelForSmallSizeFont[i];
272 if (typefacesMatchesFamily(tf.get(), family)) {
273 result->setMinSizeForSubpixel(minSizeForSubpixelForFont);
274 break;
275 }
276 }
277
251 return result; 278 return result;
252 } 279 }
253 280
254 } // namespace blink 281 } // namespace blink
OLDNEW
« 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