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

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

Issue 2138613002: Set the font family for the "system-ui" generic font family on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP Created 4 years, 2 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 21 matching lines...) Expand all
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 "third_party/skia/include/core/SkTypeface.h" 37 #include "third_party/skia/include/core/SkTypeface.h"
38 #include "third_party/skia/include/ports/SkFontMgr.h" 38 #include "third_party/skia/include/ports/SkFontMgr.h"
39 39
40 namespace blink { 40 namespace blink {
41 41
42 // static
43 const AtomicString& FontCache::systemFontFamily()
44 {
45 DEFINE_STATIC_LOCAL(AtomicString, systemFontFamilyName, ());
46 return systemFontFamilyName;
47 }
48
49 // static
50 void FontCache::setSystemFontFamily(const char* familyName)
51 {
52 NOTREACHED();
53 }
54
42 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip tion& fontDescription, UChar32 c, const SimpleFontData*, FontFallbackPriority fa llbackPriority) 55 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip tion& fontDescription, UChar32 c, const SimpleFontData*, FontFallbackPriority fa llbackPriority)
43 { 56 {
44 sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault()); 57 sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault());
45 AtomicString familyName = getFamilyNameForCharacter(fm.get(), c, fontDescrip tion, fallbackPriority); 58 AtomicString familyName = getFamilyNameForCharacter(fm.get(), c, fontDescrip tion, fallbackPriority);
46 if (familyName.isEmpty()) 59 if (familyName.isEmpty())
47 return getLastResortFallbackFont(fontDescription, DoNotRetain); 60 return getLastResortFallbackFont(fontDescription, DoNotRetain);
48 return fontDataFromFontPlatformData(getFontPlatformData(fontDescription, Fon tFaceCreationParams(familyName)), DoNotRetain); 61 return fontDataFromFontPlatformData(getFontPlatformData(fontDescription, Fon tFaceCreationParams(familyName)), DoNotRetain);
49 } 62 }
50 63
51 // static 64 // static
(...skipping 23 matching lines...) Expand all
75 default: 88 default:
76 // For other scripts, use the default generic family mapping logic. 89 // For other scripts, use the default generic family mapping logic.
77 return familyName; 90 return familyName;
78 } 91 }
79 92
80 sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault()); 93 sk_sp<SkFontMgr> fm(SkFontMgr::RefDefault());
81 return getFamilyNameForCharacter(fm.get(), examplerChar, fontDescription, Fo ntFallbackPriority::Text); 94 return getFamilyNameForCharacter(fm.get(), examplerChar, fontDescription, Fo ntFallbackPriority::Text);
82 } 95 }
83 96
84 } // namespace blink 97 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698