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
+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.
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) {
#include "config.h"
#include "FontData.h"
-#include <windows.h>
+#include <WebKitSystemInterface/WebKitSystemInterface.h>
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;
}
+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.
#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);