Changeset 222800 in webkit
- Timestamp:
- Oct 3, 2017 12:21:19 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r222795 r222800 1 2017-10-03 Adrian Perez de Castro <aperez@igalia.com> 2 3 [GTK] Support the "system" CSS font family 4 https://bugs.webkit.org/show_bug.cgi?id=177755 5 6 Reviewed by Carlos Garcia Campos. 7 8 Obtain the system UI font from the GtkSettings::gtk-font-name property 9 10 * platform/gtk/fonts/systemFont-expected.html: Added. 11 * platform/gtk/fonts/systemFont.html: Added. 12 1 13 2017-10-03 Daniel Bates <dabates@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r222795 r222800 1 2017-10-03 Adrian Perez de Castro <aperez@igalia.com> 2 3 [GTK] Support the "system" CSS font family 4 https://bugs.webkit.org/show_bug.cgi?id=177755 5 6 Reviewed by Carlos Garcia Campos. 7 8 Obtain the system UI font from the GtkSettings::gtk-font-name property 9 10 Test: platform/gtk/fonts/systemFont.html 11 12 * platform/graphics/freetype/FontCacheFreeType.cpp: 13 (WebCore::getFamilyNameStringFromFamily): Use defaultGtkSystemFont() 14 to handle -webkit-system-font and -webkit-system-ui. 15 (WebCore::isCommonlyUsedGenericFamily): Handle -webkit-system-font and 16 -webkit-system-ui as generic family names. 17 * platform/graphics/gtk/GtkUtilities.cpp: 18 (WebCore::defaultGtkSystemFont): Added. 19 * platform/graphics/gtk/GtkUtilities.h: Add prototype for defaultGtkSystemFont(). 20 1 21 2017-10-03 Daniel Bates <dabates@apple.com> 2 22 -
trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp
r219418 r222800 34 34 #include <wtf/text/CString.h> 35 35 36 #if PLATFORM(GTK) 37 #include "GtkUtilities.h" 38 #endif 39 36 40 namespace WebCore { 37 41 … … 158 162 if (family == fantasyFamily) 159 163 return "fantasy"; 164 165 #if PLATFORM(GTK) 166 if (family == systemUiFamily || family == "-webkit-system-font") 167 return defaultGtkSystemFont(); 168 #endif 169 160 170 return ""; 161 171 } … … 317 327 || equalLettersIgnoringASCIICase(familyNameString, "monospace") 318 328 || equalLettersIgnoringASCIICase(familyNameString, "fantasy") 329 #if PLATFORM(GTK) 330 || equalLettersIgnoringASCIICase(familyNameString, "-webkit-system-font") 331 || equalLettersIgnoringASCIICase(familyNameString, "-webkit-system-ui") 332 #endif 319 333 || equalLettersIgnoringASCIICase(familyNameString, "cursive"); 320 334 } -
trunk/Source/WebCore/platform/graphics/gtk/GdkCairoUtilities.cpp
r219595 r222800 34 34 #include <mutex> 35 35 #include <wtf/NeverDestroyed.h> 36 #include <wtf/glib/GUniquePtr.h> 36 37 37 38 namespace WebCore { -
trunk/Source/WebCore/platform/gtk/GtkUtilities.cpp
r222776 r222800 65 65 } 66 66 67 String defaultGtkSystemFont() 68 { 69 GUniqueOutPtr<char> fontString; 70 g_object_get(gtk_settings_get_default(), "gtk-font-name", &fontString.outPtr(), nullptr); 71 // We need to remove the size from the value of the property, 72 // which is separated from the font family using a space. 73 if (auto* spaceChar = strrchr(fontString.get(), ' ')) 74 *spaceChar = '\0'; 75 return String::fromUTF8(fontString.get()); 76 } 77 67 78 #if ENABLE(DEVELOPER_MODE) 68 79 static CString topLevelPath() -
trunk/Source/WebCore/platform/gtk/GtkUtilities.h
r222776 r222800 23 23 #include <wtf/WallTime.h> 24 24 #include <wtf/text/CString.h> 25 #include <wtf/text/WTFString.h> 25 26 26 27 namespace WebCore { … … 37 38 WallTime wallTimeForEvent(const GdkEvent*); 38 39 40 String defaultGtkSystemFont(); 41 39 42 #if ENABLE(DEVELOPER_MODE) 40 43 CString webkitBuildDirectory();
Note: See TracChangeset
for help on using the changeset viewer.