| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 const static FamilyWeightSuffix variantForSuffix[] = { | 274 const static FamilyWeightSuffix variantForSuffix[] = { |
| 275 {L" thin", 5, FontWeight100}, {L" extralight", 11, FontWeight200}, | 275 {L" thin", 5, FontWeight100}, {L" extralight", 11, FontWeight200}, |
| 276 {L" ultralight", 11, FontWeight200}, {L" light", 6, FontWeight300}, | 276 {L" ultralight", 11, FontWeight200}, {L" light", 6, FontWeight300}, |
| 277 {L" regular", 8, FontWeight400}, {L" medium", 7, FontWeight500}, | 277 {L" regular", 8, FontWeight400}, {L" medium", 7, FontWeight500}, |
| 278 {L" demibold", 9, FontWeight600}, {L" semibold", 9, FontWeight600}, | 278 {L" demibold", 9, FontWeight600}, {L" semibold", 9, FontWeight600}, |
| 279 {L" extrabold", 10, FontWeight800}, {L" ultrabold", 10, FontWeight800}, | 279 {L" extrabold", 10, FontWeight800}, {L" ultrabold", 10, FontWeight800}, |
| 280 {L" black", 6, FontWeight900}, {L" heavy", 6, FontWeight900}}; | 280 {L" black", 6, FontWeight900}, {L" heavy", 6, FontWeight900}}; |
| 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, TextCaseUnicodeInsensitive)) { |
| 285 String familyName = family.getString(); | 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 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 311 {L" condensed", 10, FontStretchCondensed}, | 311 {L" condensed", 10, FontStretchCondensed}, |
| 312 {L" narrow", 7, FontStretchCondensed}, | 312 {L" narrow", 7, FontStretchCondensed}, |
| 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 size_t numVariants = WTF_ARRAY_LENGTH(variantForSuffix); | 318 size_t numVariants = WTF_ARRAY_LENGTH(variantForSuffix); |
| 319 for (size_t i = 0; i < numVariants; i++) { | 319 for (size_t i = 0; i < numVariants; i++) { |
| 320 const FamilyStretchSuffix& entry = variantForSuffix[i]; | 320 const FamilyStretchSuffix& entry = variantForSuffix[i]; |
| 321 if (family.endsWith(entry.suffix, TextCaseInsensitive)) { | 321 if (family.endsWith(entry.suffix, TextCaseUnicodeInsensitive)) { |
| 322 String familyName = family.getString(); | 322 String familyName = family.getString(); |
| 323 familyName.truncate(family.length() - entry.length); | 323 familyName.truncate(family.length() - entry.length); |
| 324 adjustedName = AtomicString(familyName); | 324 adjustedName = AtomicString(familyName); |
| 325 variantStretch = entry.stretch; | 325 variantStretch = entry.stretch; |
| 326 return true; | 326 return true; |
| 327 } | 327 } |
| 328 } | 328 } |
| 329 | 329 |
| 330 return false; | 330 return false; |
| 331 } | 331 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 if (typefacesMatchesFamily(tf.get(), family)) { | 413 if (typefacesMatchesFamily(tf.get(), family)) { |
| 414 result->setMinSizeForSubpixel(minSizeForSubpixelForFont); | 414 result->setMinSizeForSubpixel(minSizeForSubpixelForFont); |
| 415 break; | 415 break; |
| 416 } | 416 } |
| 417 } | 417 } |
| 418 | 418 |
| 419 return result; | 419 return result; |
| 420 } | 420 } |
| 421 | 421 |
| 422 } // namespace blink | 422 } // namespace blink |
| OLD | NEW |