Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp

Issue 2222283002: Fix scriptCodeForHanFromSubtags() may return non-Han scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 Google Inc. All rights reserved. 2 * Copyright (c) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "platform/fonts/FontCache.h" 31 #include "platform/fonts/FontCache.h"
32 32
33 #include "platform/Language.h" 33 #include "platform/Language.h"
34 #include "platform/fonts/SimpleFontData.h" 34 #include "platform/fonts/SimpleFontData.h"
35 #include "platform/fonts/FontDescription.h" 35 #include "platform/fonts/FontDescription.h"
36 #include "platform/fonts/FontFaceCreationParams.h" 36 #include "platform/fonts/FontFaceCreationParams.h"
37 #include "platform/text/LocaleToScriptMapping.h"
38 #include "third_party/skia/include/core/SkTypeface.h" 37 #include "third_party/skia/include/core/SkTypeface.h"
39 #include "third_party/skia/include/ports/SkFontMgr.h" 38 #include "third_party/skia/include/ports/SkFontMgr.h"
40 39
41 namespace blink { 40 namespace blink {
42 41
43 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip tion& fontDescription, UChar32 c, const SimpleFontData*, FontFallbackPriority fa llbackPriority) 42 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip tion& fontDescription, UChar32 c, const SimpleFontData*, FontFallbackPriority fa llbackPriority)
44 { 43 {
45 RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault()); 44 RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault());
46 AtomicString familyName = getFamilyNameForCharacter(fm.get(), c, fontDescrip tion, fallbackPriority); 45 AtomicString familyName = getFamilyNameForCharacter(fm.get(), c, fontDescrip tion, fallbackPriority);
47 if (familyName.isEmpty()) 46 if (familyName.isEmpty())
(...skipping 19 matching lines...) Expand all
67 default: 66 default:
68 // For other scripts, use the default generic family mapping logic. 67 // For other scripts, use the default generic family mapping logic.
69 return familyName; 68 return familyName;
70 } 69 }
71 70
72 RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault()); 71 RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault());
73 return getFamilyNameForCharacter(fm.get(), examplerChar, fontDescription, Fo ntFallbackPriority::Text); 72 return getFamilyNameForCharacter(fm.get(), examplerChar, fontDescription, Fo ntFallbackPriority::Text);
74 } 73 }
75 74
76 } // namespace blink 75 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698