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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 // really used. | 217 // really used. |
218 // FIXME: Do we need to use predefined fonts "guaranteed" to exist | 218 // FIXME: Do we need to use predefined fonts "guaranteed" to exist |
219 // when we're running in layout-test mode? | 219 // when we're running in layout-test mode? |
220 if (!typefacesMatchesFamily(tf.get(), creationParams.family())) { | 220 if (!typefacesMatchesFamily(tf.get(), creationParams.family())) { |
221 return 0; | 221 return 0; |
222 } | 222 } |
223 | 223 |
224 FontPlatformData* result = new FontPlatformData(tf, | 224 FontPlatformData* result = new FontPlatformData(tf, |
225 name.data(), | 225 name.data(), |
226 fontSize, | 226 fontSize, |
227 fontDescription.weight() >= FontWeightBold && !tf->isBold() || fontDescr
iption.isSyntheticBold(), | 227 fontDescription.weight() >= FontWeight600 && !tf->isBold() || fontDescri
ption.isSyntheticBold(), |
228 fontDescription.style() == FontStyleItalic && !tf->isItalic() || fontDes
cription.isSyntheticItalic(), | 228 fontDescription.style() == FontStyleItalic && !tf->isItalic() || fontDes
cription.isSyntheticItalic(), |
229 fontDescription.orientation(), | 229 fontDescription.orientation(), |
230 s_useSubpixelPositioning); | 230 s_useSubpixelPositioning); |
231 | 231 |
232 struct FamilyMinSize { | 232 struct FamilyMinSize { |
233 const wchar_t* family; | 233 const wchar_t* family; |
234 unsigned minSize; | 234 unsigned minSize; |
235 }; | 235 }; |
236 const static FamilyMinSize minAntiAliasSizeForFont[] = { | 236 const static FamilyMinSize minAntiAliasSizeForFont[] = { |
237 { L"simsun", 11 }, | 237 { L"simsun", 11 }, |
238 { L"dotum", 12 }, | 238 { L"dotum", 12 }, |
239 { L"gulim", 12 }, | 239 { L"gulim", 12 }, |
240 { L"pmingliu", 11 } | 240 { L"pmingliu", 11 } |
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 return result; | 251 return result; |
252 } | 252 } |
253 | 253 |
254 } | 254 } |
OLD | NEW |