Fix <rdar://problem/5301994> Garbled text still showing on some sites
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jul 2007 08:44:11 +0000 (08:44 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jul 2007 08:44:11 +0000 (08:44 +0000)
WebCore:

        Fix <rdar://problem/5301994> Garbled text still showing on some sites

        Replace calls to GetGlyphIndices with wkGetGlyphs.

        Reviewed by Alice.

        * platform/win/GlyphPageTreeNodeWin.cpp:
        (WebCore::GlyphPage::fill): Use wkGetGlyphs.
        * platform/win/FontDataWin.cpp:
        (WebCore::FontData::containsCharacters):

WebKitLibraries:

        Update WebKitSystemInterface.{h,lib} for <rdar://problem/5301994>

        Reviewed by Alice.

        * win/include/WebKitSystemInterface/WebKitSystemInterface.h:
        * win/lib/WebKitSystemInterface.lib:
        * win/lib/WebKitSystemInterface_debug.lib:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@24047 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/win/FontDataWin.cpp
WebCore/platform/win/GlyphPageTreeNodeWin.cpp
WebKitLibraries/ChangeLog
WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
WebKitLibraries/win/lib/WebKitSystemInterface.lib
WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib

index 59c3935579fd2c8a8cff00fd1feed7a82d4333e4..332f2d94cada8a64d6503928e913a4744e9ed945 100644 (file)
@@ -1,3 +1,16 @@
+2007-07-06  Adam Roben  <aroben@apple.com>
+
+        Fix <rdar://problem/5301994> Garbled text still showing on some sites
+
+        Replace calls to GetGlyphIndices with wkGetGlyphs.
+
+        Reviewed by Alice.
+
+        * platform/win/GlyphPageTreeNodeWin.cpp:
+        (WebCore::GlyphPage::fill): Use wkGetGlyphs.
+        * platform/win/FontDataWin.cpp:
+        (WebCore::FontData::containsCharacters):
+
 2007-07-06  Matt Lilek  <pewtermoose@gmail.com>
 
         Not reviewed - Windows build fix.
index 29c42bc7f95a8427e61708252873b9527f7681b5..2780cfdd51c563185ff2eed8de5a9a54ef603b36 100644 (file)
@@ -144,15 +144,8 @@ FontData* FontData::smallCapsFontData(const FontDescription& fontDescription) co
 
 bool FontData::containsCharacters(const UChar* characters, int length) const
 {
-    HDC dc = GetDC(0);
-    SaveDC(dc);
-    SelectObject(dc, m_font.hfont());
-
-    WORD* glyphBuffer = new WORD[length];
-    GetGlyphIndices(dc, characters, length, glyphBuffer, GGI_MARK_NONEXISTING_GLYPHS);
-    
-    RestoreDC(dc, -1);
-    ReleaseDC(0, dc);
+    Vector<CGGlyph> glyphBuffer(length);
+    wkGetGlyphs(m_font.cgFont(), characters, glyphBuffer.data(), length);
 
     for (int i = 0; i < length; i++) {
         if (glyphBuffer[i] == 0xFFFFFFFF) {
index d4593324747ce5b287f02d1a6b7724df6e39ff0f..23c56ec9bfd62ab0ea5883776ba2f60b724b0b75 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "config.h"
 #include "FontData.h"
-#include <windows.h>
+#include <WebKitSystemInterface/WebKitSystemInterface.h>
 
 namespace WebCore
 {
@@ -36,23 +36,14 @@ namespace WebCore
 bool GlyphPage::fill(UChar* buffer, unsigned bufferLength, const FontData* fontData)
 {
     // bufferLength will be greater than the glyph page size if the buffer has Unicode supplementary characters.
-    // GetGlyphIndices doesn't support this so ScriptGetCMap should be used instead. It seems that supporting this
-    // would require modifying the registry (see http://www.i18nguy.com/surrogates.html) so we won't support this for now.
+    // We won't support this for now.
     if (bufferLength > GlyphPage::size)
         return false;
 
-    HDC dc = GetDC((HWND)0);
-    SaveDC(dc);
-    SelectObject(dc, fontData->m_font.hfont());
-
-    TEXTMETRIC tm;
-    GetTextMetrics(dc, &tm);
-    WORD localGlyphBuffer[GlyphPage::size];
-    GetGlyphIndices(dc, buffer, bufferLength, localGlyphBuffer, 0);
+    CGGlyph localGlyphBuffer[GlyphPage::size];
+    wkGetGlyphs(fontData->platformData().cgFont(), buffer, localGlyphBuffer, bufferLength);
     for (unsigned i = 0; i < GlyphPage::size; i++)
         setGlyphDataForIndex(i, localGlyphBuffer[i], fontData);
-    RestoreDC(dc, -1);
-    ReleaseDC(0, dc);
     return true;
 }
 
index 3180de265b6c0bf6a3e7a9ffb26956b45de9ee72..c155f3f4870db2bea52d0404dd863edcb60e1852 100644 (file)
@@ -1,3 +1,13 @@
+2007-07-06  Adam Roben  <aroben@apple.com>
+
+        Update WebKitSystemInterface.{h,lib} for <rdar://problem/5301994>
+
+        Reviewed by Alice.
+
+        * win/include/WebKitSystemInterface/WebKitSystemInterface.h:
+        * win/lib/WebKitSystemInterface.lib:
+        * win/lib/WebKitSystemInterface_debug.lib:
+
 2007-06-29  Antti Koivisto  <antti@apple.com>
 
         Reviewed by Maciej.
index 5c55fabec232f2221733509be59c8c419a04e4ce..078db6d384544b3e0062c8f0d7a4858e6f47d125 100644 (file)
 #ifndef WebKitSystemInterface_h
 #define WebKitSystemInterface_h
 
+struct CGAffineTransform;
+struct CGSize;
+
 typedef struct CGColor* CGColorRef;
 typedef struct CGContext* CGContextRef;
+typedef unsigned short CGFontIndex;
 typedef struct CGFont* CGFontRef;
+typedef CGFontIndex CGGlyph;
+typedef wchar_t UChar;
 
 void wkSetFontSmoothingLevel(int type);
 uint32_t wkSetFontSmoothingStyle(CGContextRef cg);
 void wkRestoreFontSmoothingStyle(CGContextRef cg, uint32_t oldStyle);
 void wkGetGlyphAdvances(CGFontRef, const CGAffineTransform&, bool isSystemFont, bool isPrinterFont, CGGlyph, CGSize& advance);
+void wkGetGlyphs(CGFontRef, const UChar[], CGGlyph[], size_t count);
 void wkSetUpFontCache(size_t s);
 
 void wkDrawFocusRing(CGContextRef, CGColorRef, float radius);
index 6300a47799f89e8d4c2ded8303ce2777516fb29a..6a9946f762308daa95aecf66a59268ee3da3984a 100644 (file)
Binary files a/WebKitLibraries/win/lib/WebKitSystemInterface.lib and b/WebKitLibraries/win/lib/WebKitSystemInterface.lib differ
index b3bf84e36b8f0d788d7e94052af1a7a052c80246..096f0f78f54d87e75886a7e322dcf2ead2fb60bc 100644 (file)
Binary files a/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib and b/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib differ