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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/linux/FontCacheLinux.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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 16 matching lines...) Expand all
27 #include "platform/fonts/FontPlatformData.h" 27 #include "platform/fonts/FontPlatformData.h"
28 #include "platform/fonts/SimpleFontData.h" 28 #include "platform/fonts/SimpleFontData.h"
29 #include "public/platform/linux/WebFallbackFont.h" 29 #include "public/platform/linux/WebFallbackFont.h"
30 #include "public/platform/linux/WebSandboxSupport.h" 30 #include "public/platform/linux/WebSandboxSupport.h"
31 #include "public/platform/Platform.h" 31 #include "public/platform/Platform.h"
32 #include "ui/gfx/font_fallback_linux.h" 32 #include "ui/gfx/font_fallback_linux.h"
33 #include "wtf/text/CString.h" 33 #include "wtf/text/CString.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 AtomicString* FontCache::s_systemFontFamilyName = 0;
38
39 // static
40 const AtomicString& FontCache::systemFontFamily()
41 {
42 return *s_systemFontFamilyName;
43 }
44
45 // static
46 void FontCache::setSystemFontFamily(const char* familyName)
47 {
48 s_systemFontFamilyName = new AtomicString(familyName);
49 }
50
37 FontCache::FontCache() 51 FontCache::FontCache()
38 : m_purgePreventCount(0) 52 : m_purgePreventCount(0)
39 { 53 {
40 if (s_staticFontManager) { 54 if (s_staticFontManager) {
41 adopted(s_staticFontManager); 55 adopted(s_staticFontManager);
42 m_fontManager = sk_ref_sp(s_staticFontManager); 56 m_fontManager = sk_ref_sp(s_staticFontManager);
43 } else { 57 } else {
44 m_fontManager = nullptr; 58 m_fontManager = nullptr;
45 } 59 }
46 } 60 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 151
138 std::unique_ptr<FontPlatformData> platformData(new FontPlatformData(*substit utePlatformData)); 152 std::unique_ptr<FontPlatformData> platformData(new FontPlatformData(*substit utePlatformData));
139 platformData->setSyntheticBold(shouldSetSyntheticBold); 153 platformData->setSyntheticBold(shouldSetSyntheticBold);
140 platformData->setSyntheticItalic(shouldSetSyntheticItalic); 154 platformData->setSyntheticItalic(shouldSetSyntheticItalic);
141 return fontDataFromFontPlatformData(platformData.get(), DoNotRetain); 155 return fontDataFromFontPlatformData(platformData.get(), DoNotRetain);
142 } 156 }
143 157
144 #endif // !OS(ANDROID) 158 #endif // !OS(ANDROID)
145 159
146 } // namespace blink 160 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698