OLD | NEW |
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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 }; | 236 }; |
237 size_t numFonts = WTF_ARRAY_LENGTH(minAntiAliasSizeForFont); | 237 size_t numFonts = WTF_ARRAY_LENGTH(minAntiAliasSizeForFont); |
238 for (size_t i = 0; i < numFonts; i++) { | 238 for (size_t i = 0; i < numFonts; i++) { |
239 FamilyMinSize entry = minAntiAliasSizeForFont[i]; | 239 FamilyMinSize entry = minAntiAliasSizeForFont[i]; |
240 if (typefacesMatchesFamily(tf.get(), entry.family)) { | 240 if (typefacesMatchesFamily(tf.get(), entry.family)) { |
241 result->setMinSizeForAntiAlias(entry.minSize); | 241 result->setMinSizeForAntiAlias(entry.minSize); |
242 break; | 242 break; |
243 } | 243 } |
244 } | 244 } |
245 | 245 |
| 246 // List of fonts that look bad with subpixel text rendering at smaller font |
| 247 // sizes. This includes all fonts in the Microsoft Core fonts for the Web |
| 248 // collection. |
| 249 const static wchar_t* noSubpixelForSmallSizeFont[] = { |
| 250 L"andale mono", |
| 251 L"arial", |
| 252 L"comic sans", |
| 253 L"courier new", |
| 254 L"georgia", |
| 255 L"impact", |
| 256 L"lucida console", |
| 257 L"tahoma", |
| 258 L"times new roman", |
| 259 L"trebuchet ms", |
| 260 L"verdana", |
| 261 L"webdings" |
| 262 }; |
| 263 const static float minSizeForSubpixelForFont = 16.0f; |
| 264 numFonts = WTF_ARRAY_LENGTH(noSubpixelForSmallSizeFont); |
| 265 for (size_t i = 0; i < numFonts; i++) { |
| 266 const wchar_t* family = noSubpixelForSmallSizeFont[i]; |
| 267 if (typefacesMatchesFamily(tf.get(), family)) { |
| 268 result->setMinSizeForSubpixel(minSizeForSubpixelForFont); |
| 269 break; |
| 270 } |
| 271 } |
| 272 |
246 return result; | 273 return result; |
247 } | 274 } |
248 | 275 |
249 } | 276 } |
OLD | NEW |