Title: [97133] trunk/Source/WebCore
- Revision
- 97133
- Author
- [email protected]
- Date
- 2011-10-11 01:38:43 -0700 (Tue, 11 Oct 2011)
Log Message
[Chromium] Complex script code path breaks on Windows XP when a CFF font is used
https://bugs.webkit.org/show_bug.cgi?id=69497
Reviewed by Kent Tamura.
Don't use CFF webfonts when ScriptShape() can't handle it.
ScriptShape() indicates us the case by setting fNoGlyphIndex to TRUE.
If it's TRUE, we don't use the font. This could happen with early
version of Uniscribe on WinXP.
No new tests because the version of Uniscribe depends on environment.
One can install newer version of Uniscribe on WinXP.
* platform/graphics/chromium/UniscribeHelper.cpp:
(WebCore::canUseGlyphIndex): Added.
(WebCore::UniscribeHelper::shape): Don't use the shape result when canUseGlyphIndex() returns false.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (97132 => 97133)
--- trunk/Source/WebCore/ChangeLog 2011-10-11 08:28:00 UTC (rev 97132)
+++ trunk/Source/WebCore/ChangeLog 2011-10-11 08:38:43 UTC (rev 97133)
@@ -1,3 +1,22 @@
+2011-10-11 Kenichi Ishibashi <[email protected]>
+
+ [Chromium] Complex script code path breaks on Windows XP when a CFF font is used
+ https://bugs.webkit.org/show_bug.cgi?id=69497
+
+ Reviewed by Kent Tamura.
+
+ Don't use CFF webfonts when ScriptShape() can't handle it.
+ ScriptShape() indicates us the case by setting fNoGlyphIndex to TRUE.
+ If it's TRUE, we don't use the font. This could happen with early
+ version of Uniscribe on WinXP.
+
+ No new tests because the version of Uniscribe depends on environment.
+ One can install newer version of Uniscribe on WinXP.
+
+ * platform/graphics/chromium/UniscribeHelper.cpp:
+ (WebCore::canUseGlyphIndex): Added.
+ (WebCore::UniscribeHelper::shape): Don't use the shape result when canUseGlyphIndex() returns false.
+
2011-10-11 John Bauman <[email protected]>
Fix crash with toDataURL to JPEG
Modified: trunk/Source/WebCore/platform/graphics/chromium/UniscribeHelper.cpp (97132 => 97133)
--- trunk/Source/WebCore/platform/graphics/chromium/UniscribeHelper.cpp 2011-10-11 08:28:00 UTC (rev 97132)
+++ trunk/Source/WebCore/platform/graphics/chromium/UniscribeHelper.cpp 2011-10-11 08:38:43 UTC (rev 97133)
@@ -106,6 +106,15 @@
*style = getStyleFromLogfont(logfont);
}
+static bool canUseGlyphIndex(const SCRIPT_ITEM& run)
+{
+ // On early version of Uniscribe, ScriptShape() sets run.a.fNoGlyphIndex
+ // to TRUE when it can't shape the run with glyph indexes. This could
+ // occur when we use CFF webfonts(See http://crbug.com/39017).
+ // We don't use the font in that case and try to use fallback fonts.
+ return !run.a.fNoGlyphIndex;
+}
+
UniscribeHelper::UniscribeHelper(const UChar* input,
int inputLength,
bool isRtl,
@@ -594,6 +603,7 @@
shaping.m_visualAttributes.resize(numGlyphs);
charProps.resize(itemLength);
glyphProps.resize(numGlyphs);
+ run.a.fNoGlyphIndex = FALSE;
#ifdef PURIFY
// http://code.google.com/p/chromium/issues/detail?id=5309
@@ -639,7 +649,7 @@
} else if (hr == E_OUTOFMEMORY) {
numGlyphs *= 2;
continue;
- } else if (SUCCEEDED(hr) && (lastFallbackTried || !containsMissingGlyphs(shaping, run, fontProperties)))
+ } else if (SUCCEEDED(hr) && (lastFallbackTried || !containsMissingGlyphs(shaping, run, fontProperties) && canUseGlyphIndex(run)))
break;
// The current font can't render this run. clear DC and try
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes