| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 void FontCache::addSideloadedFontForTesting(SkTypeface* typeface) | 70 void FontCache::addSideloadedFontForTesting(SkTypeface* typeface) |
| 71 { | 71 { |
| 72 if (!s_sideloadedFonts) | 72 if (!s_sideloadedFonts) |
| 73 s_sideloadedFonts = new HashMap<String, sk_sp<SkTypeface>>; | 73 s_sideloadedFonts = new HashMap<String, sk_sp<SkTypeface>>; |
| 74 SkString name; | 74 SkString name; |
| 75 typeface->getFamilyName(&name); | 75 typeface->getFamilyName(&name); |
| 76 s_sideloadedFonts->set(name.c_str(), sk_sp<SkTypeface>(typeface)); | 76 s_sideloadedFonts->set(name.c_str(), sk_sp<SkTypeface>(typeface)); |
| 77 } | 77 } |
| 78 | 78 |
| 79 // static | 79 // static |
| 80 const AtomicString& FontCache::systemFontFamily() |
| 81 { |
| 82 return *s_menuFontFamilyName; |
| 83 } |
| 84 |
| 85 // static |
| 80 void FontCache::setMenuFontMetrics(const wchar_t* familyName, int32_t fontHeight
) | 86 void FontCache::setMenuFontMetrics(const wchar_t* familyName, int32_t fontHeight
) |
| 81 { | 87 { |
| 82 s_menuFontFamilyName = new AtomicString(familyName); | 88 s_menuFontFamilyName = new AtomicString(familyName); |
| 83 s_menuFontHeight = ensureMinimumFontHeightIfNeeded(fontHeight); | 89 s_menuFontHeight = ensureMinimumFontHeightIfNeeded(fontHeight); |
| 84 } | 90 } |
| 85 | 91 |
| 86 // static | 92 // static |
| 87 void FontCache::setSmallCaptionFontMetrics(const wchar_t* familyName, int32_t fo
ntHeight) | 93 void FontCache::setSmallCaptionFontMetrics(const wchar_t* familyName, int32_t fo
ntHeight) |
| 88 { | 94 { |
| 89 s_smallCaptionFontFamilyName = new AtomicString(familyName); | 95 s_smallCaptionFontFamilyName = new AtomicString(familyName); |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 if (typefacesMatchesFamily(tf.get(), family)) { | 450 if (typefacesMatchesFamily(tf.get(), family)) { |
| 445 result->setMinSizeForSubpixel(minSizeForSubpixelForFont); | 451 result->setMinSizeForSubpixel(minSizeForSubpixelForFont); |
| 446 break; | 452 break; |
| 447 } | 453 } |
| 448 } | 454 } |
| 449 | 455 |
| 450 return result; | 456 return result; |
| 451 } | 457 } |
| 452 | 458 |
| 453 } // namespace blink | 459 } // namespace blink |
| OLD | NEW |