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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 adjustedFontDescription.setStretch(variantStretch); | 362 adjustedFontDescription.setStretch(variantStretch); |
363 tf = createTypeface(adjustedFontDescription, adjustedParams, name); | 363 tf = createTypeface(adjustedFontDescription, adjustedParams, name); |
364 if (!tf || !typefacesMatchesFamily(tf.get(), adjustedName)) | 364 if (!tf || !typefacesMatchesFamily(tf.get(), adjustedName)) |
365 return nullptr; | 365 return nullptr; |
366 | 366 |
367 } else { | 367 } else { |
368 return nullptr; | 368 return nullptr; |
369 } | 369 } |
370 } | 370 } |
371 | 371 |
372 std::unique_ptr<FontPlatformData> result = wrapUnique(new FontPlatformData( | 372 std::unique_ptr<FontPlatformData> result = |
373 tf, name.data(), fontSize, | 373 WTF::wrapUnique(new FontPlatformData( |
374 (fontDescription.weight() >= FontWeight600 && !tf->isBold()) || | 374 tf, name.data(), fontSize, |
375 fontDescription.isSyntheticBold(), | 375 (fontDescription.weight() >= FontWeight600 && !tf->isBold()) || |
376 ((fontDescription.style() == FontStyleItalic || | 376 fontDescription.isSyntheticBold(), |
377 fontDescription.style() == FontStyleOblique) && | 377 ((fontDescription.style() == FontStyleItalic || |
378 !tf->isItalic()) || | 378 fontDescription.style() == FontStyleOblique) && |
379 fontDescription.isSyntheticItalic(), | 379 !tf->isItalic()) || |
380 fontDescription.orientation())); | 380 fontDescription.isSyntheticItalic(), |
| 381 fontDescription.orientation())); |
381 | 382 |
382 struct FamilyMinSize { | 383 struct FamilyMinSize { |
383 const wchar_t* family; | 384 const wchar_t* family; |
384 unsigned minSize; | 385 unsigned minSize; |
385 }; | 386 }; |
386 const static FamilyMinSize minAntiAliasSizeForFont[] = { | 387 const static FamilyMinSize minAntiAliasSizeForFont[] = { |
387 {L"simsun", 11}, | 388 {L"simsun", 11}, |
388 {L"dotum", 12}, | 389 {L"dotum", 12}, |
389 {L"gulim", 12}, | 390 {L"gulim", 12}, |
390 {L"pmingliu", 11}, | 391 {L"pmingliu", 11}, |
(...skipping 22 matching lines...) Expand all Loading... |
413 if (typefacesMatchesFamily(tf.get(), family)) { | 414 if (typefacesMatchesFamily(tf.get(), family)) { |
414 result->setMinSizeForSubpixel(minSizeForSubpixelForFont); | 415 result->setMinSizeForSubpixel(minSizeForSubpixelForFont); |
415 break; | 416 break; |
416 } | 417 } |
417 } | 418 } |
418 | 419 |
419 return result; | 420 return result; |
420 } | 421 } |
421 | 422 |
422 } // namespace blink | 423 } // namespace blink |
OLD | NEW |