summaryrefslogtreecommitdiffstats
path: root/webkit/port
diff options
context:
space:
mode:
authorjungshik@google.com <jungshik@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-28 02:57:39 +0000
committerjungshik@google.com <jungshik@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-28 02:57:39 +0000
commit16e603736b51b3eeefcfe05d28f639b5171b5dad (patch)
tree8bc3de293fba61b4c3044485e9925153b049a40e /webkit/port
parent6e683db29d1f0d8c90faf03d37f7a14ad9d55f8d (diff)
downloadchromium_src-16e603736b51b3eeefcfe05d28f639b5171b5dad.zip
chromium_src-16e603736b51b3eeefcfe05d28f639b5171b5dad.tar.gz
chromium_src-16e603736b51b3eeefcfe05d28f639b5171b5dad.tar.bz2
Check the return value of GetFontUnicodeRange. If it fails, call EnsureFontLoaded (to load font in the browser
process) and try again. Google Georgian is the easiest to reproduce and test, but a similar symptom was reported for Chinese and Japanese pages. BUG=1346275 TEST=In Simplified Chinese XP VM, go to http://www.google.ge and see Georgian characters are rendered correctly. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1477 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port')
-rw-r--r--webkit/port/platform/graphics/FontCacheWin.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/webkit/port/platform/graphics/FontCacheWin.cpp b/webkit/port/platform/graphics/FontCacheWin.cpp
index caa1bde..29fe120 100644
--- a/webkit/port/platform/graphics/FontCacheWin.cpp
+++ b/webkit/port/platform/graphics/FontCacheWin.cpp
@@ -296,12 +296,25 @@ static bool fontContainsCharacter(const FontPlatformData* font_data,
HFONT hfont = font_data->hfont();
HDC hdc = GetDC(0);
HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(hdc, hfont));
+ int count = GetFontUnicodeRanges(hdc, 0);
+ if (count == 0) {
+ if (webkit_glue::EnsureFontLoaded(hfont))
+ count = GetFontUnicodeRanges(hdc, 0);
+ }
+ if (count == 0) {
+ ASSERT_NOT_REACHED();
+ SelectObject(hdc, oldFont);
+ ReleaseDC(0, hdc);
+ return true;
+ }
+
static Vector<char, 512> glyphsetBuffer;
glyphsetBuffer.resize(GetFontUnicodeRanges(hdc, 0));
GLYPHSET* glyphset = reinterpret_cast<GLYPHSET*>(glyphsetBuffer.data());
// In addition, refering to the OS/2 table and converting the codepage list
// to the coverage map might be faster.
- GetFontUnicodeRanges(hdc, glyphset);
+ count = GetFontUnicodeRanges(hdc, glyphset);
+ ASSERT(count > 0);
SelectObject(hdc, oldFont);
ReleaseDC(0, hdc);