| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 { L" semibold", 9, FontWeight600 }, | 275 { L" semibold", 9, FontWeight600 }, |
| 276 { L" extrabold", 10, FontWeight800 }, | 276 { L" extrabold", 10, FontWeight800 }, |
| 277 { L" ultrabold", 10, FontWeight800 }, | 277 { L" ultrabold", 10, FontWeight800 }, |
| 278 { L" black", 6, FontWeight900 }, | 278 { L" black", 6, FontWeight900 }, |
| 279 { L" heavy", 6, FontWeight900 } | 279 { L" heavy", 6, FontWeight900 } |
| 280 }; | 280 }; |
| 281 size_t numVariants = WTF_ARRAY_LENGTH(variantForSuffix); | 281 size_t numVariants = WTF_ARRAY_LENGTH(variantForSuffix); |
| 282 for (size_t i = 0; i < numVariants; i++) { | 282 for (size_t i = 0; i < numVariants; i++) { |
| 283 const FamilyWeightSuffix& entry = variantForSuffix[i]; | 283 const FamilyWeightSuffix& entry = variantForSuffix[i]; |
| 284 if (family.endsWith(entry.suffix, TextCaseInsensitive)) { | 284 if (family.endsWith(entry.suffix, TextCaseInsensitive)) { |
| 285 String familyName = family.string(); | 285 String familyName = family.getString(); |
| 286 familyName.truncate(family.length() - entry.length); | 286 familyName.truncate(family.length() - entry.length); |
| 287 adjustedName = AtomicString(familyName); | 287 adjustedName = AtomicString(familyName); |
| 288 variantWeight = entry.weight; | 288 variantWeight = entry.weight; |
| 289 return true; | 289 return true; |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 | 292 |
| 293 return false; | 293 return false; |
| 294 } | 294 } |
| 295 | 295 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 313 { L" semicondensed", 14, FontStretchSemiCondensed }, | 313 { L" semicondensed", 14, FontStretchSemiCondensed }, |
| 314 { L" semiexpanded", 13, FontStretchSemiExpanded }, | 314 { L" semiexpanded", 13, FontStretchSemiExpanded }, |
| 315 { L" expanded", 9, FontStretchExpanded }, | 315 { L" expanded", 9, FontStretchExpanded }, |
| 316 { L" extraexpanded", 14, FontStretchExtraExpanded }, | 316 { L" extraexpanded", 14, FontStretchExtraExpanded }, |
| 317 { L" ultraexpanded", 14, FontStretchUltraExpanded } | 317 { L" ultraexpanded", 14, FontStretchUltraExpanded } |
| 318 }; | 318 }; |
| 319 size_t numVariants = WTF_ARRAY_LENGTH(variantForSuffix); | 319 size_t numVariants = WTF_ARRAY_LENGTH(variantForSuffix); |
| 320 for (size_t i = 0; i < numVariants; i++) { | 320 for (size_t i = 0; i < numVariants; i++) { |
| 321 const FamilyStretchSuffix& entry = variantForSuffix[i]; | 321 const FamilyStretchSuffix& entry = variantForSuffix[i]; |
| 322 if (family.endsWith(entry.suffix, TextCaseInsensitive)) { | 322 if (family.endsWith(entry.suffix, TextCaseInsensitive)) { |
| 323 String familyName = family.string(); | 323 String familyName = family.getString(); |
| 324 familyName.truncate(family.length() - entry.length); | 324 familyName.truncate(family.length() - entry.length); |
| 325 adjustedName = AtomicString(familyName); | 325 adjustedName = AtomicString(familyName); |
| 326 variantStretch = entry.stretch; | 326 variantStretch = entry.stretch; |
| 327 return true; | 327 return true; |
| 328 } | 328 } |
| 329 } | 329 } |
| 330 | 330 |
| 331 return false; | 331 return false; |
| 332 } | 332 } |
| 333 | 333 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 if (typefacesMatchesFamily(tf.get(), family)) { | 422 if (typefacesMatchesFamily(tf.get(), family)) { |
| 423 result->setMinSizeForSubpixel(minSizeForSubpixelForFont); | 423 result->setMinSizeForSubpixel(minSizeForSubpixelForFont); |
| 424 break; | 424 break; |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 | 427 |
| 428 return result.release(); | 428 return result.release(); |
| 429 } | 429 } |
| 430 | 430 |
| 431 } // namespace blink | 431 } // namespace blink |
| OLD | NEW |