[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
commit-queue at webkit.org
commit-queue at webkit.org
Sun Feb 20 23:52:54 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 46685305812e9c0c5c8bc8754f5134007d96068b
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jan 26 10:12:50 2011 +0000
2011-01-26 Hironori Bono <hbono at chromium.org>
Reviewed by Kent Tamura.
A speculative fix for Bug 52422 - [chromium] More crash in
FontFallbackList::determinePitch(const Font* font)
https://bugs.webkit.org/show_bug.cgi?id=52422
My previous change may not work on non-US Windows whose system fonts
have localized aliases matching to the system locale because of a
font-name mismatch in createFontIndirectAndGetWinName(). This change
tries all the fonts installed in a PC and returns the first font that we
can create without errors.
* platform/graphics/chromium/FontCacheChromiumWin.cpp:
(WebCore::GetLastResortFallbackFontProcData::GetLastResortFallbackFontProcData):
Added a struct used for getLastResortFallbackFontProc().
(WebCore::getLastResortFallbackFontProc): Added a callback for EnumFontFamilies().
(WebCore::FontCache::getLastResortFallbackFont): Use EnumFontFamilies() to find a last-resort font.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 43e6c70..ca9dfdd 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2011-01-26 Hironori Bono <hbono at chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ A speculative fix for Bug 52422 - [chromium] More crash in
+ FontFallbackList::determinePitch(const Font* font)
+ https://bugs.webkit.org/show_bug.cgi?id=52422
+
+ My previous change may not work on non-US Windows whose system fonts
+ have localized aliases matching to the system locale because of a
+ font-name mismatch in createFontIndirectAndGetWinName(). This change
+ tries all the fonts installed in a PC and returns the first font that we
+ can create without errors.
+
+ * platform/graphics/chromium/FontCacheChromiumWin.cpp:
+ (WebCore::GetLastResortFallbackFontProcData::GetLastResortFallbackFontProcData):
+ Added a struct used for getLastResortFallbackFontProc().
+ (WebCore::getLastResortFallbackFontProc): Added a callback for EnumFontFamilies().
+ (WebCore::FontCache::getLastResortFallbackFont): Use EnumFontFamilies() to find a last-resort font.
+
2011-01-26 James Robinson <jamesr at chromium.org>
Reviewed by Nate Chapin.
diff --git a/Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp b/Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
index f4c0dee..33ebc59 100644
--- a/Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
+++ b/Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
@@ -399,6 +399,28 @@ static int CALLBACK traitsInFamilyEnumProc(CONST LOGFONT* logFont, CONST TEXTMET
return 1;
}
+struct GetLastResortFallbackFontProcData {
+ GetLastResortFallbackFontProcData(FontCache* fontCache, const FontDescription* fontDescription, wchar_t* fontName)
+ : m_fontCache(fontCache)
+ , m_fontDescription(fontDescription)
+ , m_fontName(fontName)
+ , m_fontData(0)
+ {
+ }
+
+ FontCache* m_fontCache;
+ const FontDescription* m_fontDescription;
+ wchar_t* m_fontName;
+ SimpleFontData* m_fontData;
+};
+
+static int CALLBACK getLastResortFallbackFontProc(const LOGFONT* logFont, const TEXTMETRIC* metrics, DWORD fontType, LPARAM lParam)
+{
+ GetLastResortFallbackFontProcData* procData = reinterpret_cast<GetLastResortFallbackFontProcData*>(lParam);
+ procData->m_fontData = fontDataFromDescriptionAndLogFont(procData->m_fontCache, *procData->m_fontDescription, *logFont, procData->m_fontName);
+ return !procData->m_fontData;
+}
+
void FontCache::platformInit()
{
// Not needed on Windows.
@@ -548,6 +570,21 @@ SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& desc
return simpleFont;
}
+ // Fall back to all the fonts installed in this PC. When a font has a
+ // localized name according to the system locale as well as an English name,
+ // both GetTextFace() and EnumFontFamilies() return the localized name. So,
+ // FontCache::createFontPlatformData() does not filter out the fonts
+ // returned by this EnumFontFamilies() call.
+ HDC dc = GetDC(0);
+ if (dc) {
+ GetLastResortFallbackFontProcData procData(this, &description, fallbackFontName);
+ EnumFontFamilies(dc, 0, getLastResortFallbackFontProc, reinterpret_cast<LPARAM>(&procData));
+ ReleaseDC(0, dc);
+
+ if (procData.m_fontData)
+ return procData.m_fontData;
+ }
+
ASSERT_NOT_REACHED();
return 0;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list