Changeset 48791 in webkit
- Timestamp:
- Sep 26, 2009 10:51:12 AM (15 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r48772 r48791 1 2009-09-26 Zan Dobersek <zandobersek@gmail.com> 2 3 Reviewed by Gustavo Noronha. 4 5 [Layout tests] [Gtk] Gtk DumpRenderTree should use WebKit test fonts 6 https://bugs.webkit.org/show_bug.cgi?id=29689 7 8 Load test fonts through FontConfig before each test. 9 This ensures a more proper rendering of the tests. 10 11 * DumpRenderTree/gtk/DumpRenderTree.cpp: 12 (initializeFonts): 13 (runTest): 14 (main): 15 * DumpRenderTree/gtk/fonts.conf: Copied from WebKitTools/DumpRenderTree/qt/fonts.conf. 16 * GNUmakefile.am: 17 1 18 2009-09-25 David Kilzer <ddkilzer@apple.com> 2 19 -
trunk/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
r48721 r48791 45 45 #include <wtf/Assertions.h> 46 46 47 #if PLATFORM(X11) 48 #include <fontconfig/fontconfig.h> 49 #endif 50 47 51 #include <cassert> 48 52 #include <getopt.h> … … 126 130 g_free(oldString); 127 131 } 132 133 #if PLATFORM(X11) 134 static void initializeFonts() 135 { 136 static int numFonts = -1; 137 138 // Some tests may add or remove fonts via the @font-face rule. 139 // If that happens, font config should be re-created to suppress any unwanted change. 140 FcFontSet* appFontSet = FcConfigGetFonts(0, FcSetApplication); 141 if (appFontSet && numFonts >= 0 && appFontSet->nfont == numFonts) 142 return; 143 144 const char* fontDirEnv = g_getenv("WEBKIT_TESTFONTS"); 145 if (!fontDirEnv) 146 g_error("WEBKIT_TESTFONTS environment variable is not set, but it should point to the directory " 147 "containing the fonts you can clone from git://gitorious.org/qtwebkit/testfonts.git\n"); 148 149 GFile* fontDir = g_file_new_for_path(fontDirEnv); 150 if (!fontDir || !g_file_query_exists(fontDir, NULL)) 151 g_error("WEBKIT_TESTFONTS environment variable is not set correctly - it should point to the directory " 152 "containing the fonts you can clone from git://gitorious.org/qtwebkit/testfonts.git\n"); 153 154 FcConfig *config = FcConfigCreate(); 155 if (!FcConfigParseAndLoad (config, (FcChar8*) FONTS_CONF_FILE, true)) 156 g_error("Couldn't load font configuration file"); 157 if (!FcConfigAppFontAddDir (config, (FcChar8*) g_file_get_path(fontDir))) 158 g_error("Couldn't add font dir!"); 159 FcConfigSetCurrent(config); 160 161 g_object_unref(fontDir); 162 163 appFontSet = FcConfigGetFonts(config, FcSetApplication); 164 numFonts = appFontSet->nfont; 165 } 166 #endif 128 167 129 168 static gchar* dumpFramesAsText(WebKitWebFrame* frame) … … 430 469 if (prevTestBFItem) 431 470 g_object_ref(prevTestBFItem); 471 472 #if PLATFORM(X11) 473 initializeFonts(); 474 #endif 432 475 433 476 // Focus the web view before loading the test to avoid focusing problems … … 708 751 gtk_init(&argc, &argv); 709 752 753 #if PLATFORM(X11) 754 FcInit(); 755 initializeFonts(); 756 #endif 757 710 758 struct option options[] = { 711 759 {"notree", no_argument, &dumpTree, false}, -
trunk/WebKitTools/GNUmakefile.am
r48228 r48791 108 108 109 109 dumprendertree_cppflags += \ 110 -DTEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" 110 -DTEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" \ 111 -DFONTS_CONF_FILE=\"${shell pwd}/${srcdir}/WebKitTools/DumpRenderTree/gtk/fonts.conf\" 111 112 112 113 TestNetscapePlugin_libtestnetscapeplugin_la_CPPFLAGS = \
Note: See TracChangeset
for help on using the changeset viewer.