[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

jhoneycutt at apple.com jhoneycutt at apple.com
Wed Dec 22 11:41:27 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit eb9b418d68ed36986c6b24021dcb09a2065ee029
Author: jhoneycutt at apple.com <jhoneycutt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 3 22:55:12 2010 +0000

    WebKitTestRunner needs to support loading custom fonts (via the
    WEBKIT_TESTFONTS environment variable)
    https://bugs.webkit.org/show_bug.cgi?id=42782
    
    Reviewed by Adam Roben.
    
    * WebKitTestRunner/InjectedBundle/win/ActivateFonts.cpp:
    (WTR::fontsPath):
    Copied from DRT code. Removed the fallback to DumpRenderTree.resources/,
    as this directory doesn't appear to be created anymore.
    (WTR::activateFonts):
    Loop through the fonts, and call AddFontResourceExW() for each.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64601 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 64f2755..d66f927 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -137,6 +137,21 @@
 
 2010-08-02  Jon Honeycutt  <jhoneycutt at apple.com>
 
+        WebKitTestRunner needs to support loading custom fonts (via the
+        WEBKIT_TESTFONTS environment variable)
+        https://bugs.webkit.org/show_bug.cgi?id=42782
+
+        Reviewed by Adam Roben.
+
+        * WebKitTestRunner/InjectedBundle/win/ActivateFonts.cpp:
+        (WTR::fontsPath):
+        Copied from DRT code. Removed the fallback to DumpRenderTree.resources/,
+        as this directory doesn't appear to be created anymore.
+        (WTR::activateFonts):
+        Loop through the fonts, and call AddFontResourceExW() for each.
+
+2010-08-02  Jon Honeycutt  <jhoneycutt at apple.com>
+
         Restore the WebKitTestRunner.sln that was removed, and remove the
         correct one.
 
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/win/ActivateFonts.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/win/ActivateFonts.cpp
index c7532ce..d9f08c9 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/win/ActivateFonts.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/win/ActivateFonts.cpp
@@ -25,11 +25,83 @@
 
 #include "ActivateFonts.h"
 
+#include <string>
+#include <wtf/Vector.h>
+
+static LPCWSTR fontsEnvironmentVariable = L"WEBKIT_TESTFONTS";
+
 namespace WTR {
 
+using namespace std;
+
+static const wstring& fontsPath()
+{
+    static wstring path;
+    static bool initialized;
+
+    if (initialized)
+        return path;
+    initialized = true;
+
+    DWORD size = ::GetEnvironmentVariableW(fontsEnvironmentVariable, 0, 0);
+    Vector<WCHAR> buffer(size);
+    if (!::GetEnvironmentVariableW(fontsEnvironmentVariable, buffer.data(), buffer.size()))
+        return path;
+
+    path = buffer.data();
+    if (path[path.length() - 1] != '\\')
+        path.append(L"\\");
+
+    return path;
+}
+
+
 void activateFonts()
 {
-    // FIXME: Not implemented.
+    static LPCWSTR fontsToInstall[] = {
+        TEXT("AHEM____.ttf"),
+        TEXT("Apple Chancery.ttf"),
+        TEXT("Courier Bold.ttf"),
+        TEXT("Courier.ttf"),
+        TEXT("Helvetica Bold Oblique.ttf"),
+        TEXT("Helvetica Bold.ttf"),
+        TEXT("Helvetica Oblique.ttf"),
+        TEXT("Helvetica.ttf"),
+        TEXT("Helvetica Neue Bold Italic.ttf"),
+        TEXT("Helvetica Neue Bold.ttf"),
+        TEXT("Helvetica Neue Condensed Black.ttf"),
+        TEXT("Helvetica Neue Condensed Bold.ttf"),
+        TEXT("Helvetica Neue Italic.ttf"),
+        TEXT("Helvetica Neue Light Italic.ttf"),
+        TEXT("Helvetica Neue Light.ttf"),
+        TEXT("Helvetica Neue UltraLight Italic.ttf"),
+        TEXT("Helvetica Neue UltraLight.ttf"),
+        TEXT("Helvetica Neue.ttf"),
+        TEXT("Lucida Grande.ttf"),
+        TEXT("Lucida Grande Bold.ttf"),
+        TEXT("Monaco.ttf"),
+        TEXT("Papyrus.ttf"),
+        TEXT("Times Bold Italic.ttf"),
+        TEXT("Times Bold.ttf"),
+        TEXT("Times Italic.ttf"),
+        TEXT("Times Roman.ttf"),
+        TEXT("WebKit Layout Tests 2.ttf"),
+        TEXT("WebKit Layout Tests.ttf"),
+        TEXT("WebKitWeightWatcher100.ttf"),
+        TEXT("WebKitWeightWatcher200.ttf"),
+        TEXT("WebKitWeightWatcher300.ttf"),
+        TEXT("WebKitWeightWatcher400.ttf"),
+        TEXT("WebKitWeightWatcher500.ttf"),
+        TEXT("WebKitWeightWatcher600.ttf"),
+        TEXT("WebKitWeightWatcher700.ttf"),
+        TEXT("WebKitWeightWatcher800.ttf"),
+        TEXT("WebKitWeightWatcher900.ttf")
+    };
+
+    wstring resourcesPath = fontsPath();
+
+    for (unsigned i = 0; i < ARRAYSIZE(fontsToInstall); ++i)
+        ::AddFontResourceExW(wstring(resourcesPath + fontsToInstall[i]).c_str(), FR_PRIVATE, 0);
 }
 
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list