Reviewed by Sam Weinig.
- fix <rdar://problem/
5622336> Burmese text does not render on http://www.myanmarbible.com/bible/Judson/html/index.html
Test: platform/win/fast/text/uniscribe-missing-glyph.html
Note that default installations of Windows do not have Myanmar fonts.
What this patch does is ensure that the Myanmar and other complex
scripts are rendered as missing glyphs rather than not rendered at all.
The particular page in the bug measures the relative widths of two
rendered strings and, if they are rendered as missing glyphs, detects
that a Myanmar fonts is not available and substitutes the text with
images. By not rendering (and measuring) missing glyphs, WebKit was
throwing the page's detection code off.
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::shape): Removed an early return in case
shaping resulted in missing glyphs. This is now expected if font
fallback failed to produce a font containing glyphs for the character.
Also changed two resize()s to shrink()s.
LayoutTests:
- test for <rdar://problem/
5622336> Burmese text does not render on http://www.myanmarbible.com/bible/Judson/html/index.html
* platform/win/fast/text/uniscribe-missing-glyph-expected.txt: Added.
* platform/win/fast/text/uniscribe-missing-glyph.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30747
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2008-03-04 Dan Bernstein <mitz@apple.com>
+
+ - test for <rdar://problem/5622336> Burmese text does not render on http://www.myanmarbible.com/bible/Judson/html/index.html
+
+ * platform/win/fast/text/uniscribe-missing-glyph-expected.txt: Added.
+ * platform/win/fast/text/uniscribe-missing-glyph.html: Added.
+
2008-03-04 Alexey Proskuryakov <ap@webkit.org>
Suggested by Darin, rubber-stamped by Mark.
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {P} at (0,0) size 784x18
+ RenderText {#text} at (0,0) size 762x18
+ text run at (0,0) width 762: "This tests that the Uniscribe code path renders missing glyphs as squares. It assumes that a Myanmar font is not available."
+ RenderBlock (anonymous) at (0,34) size 784x72
+ RenderText {#text} at (0,0) size 22x18
+ text run at (0,0) width 22: "(\x{1000})"
+ RenderBR {BR} at (22,14) size 0x0
+ RenderText {#text} at (0,18) size 34x18
+ text run at (0,18) width 34: "(\x{1000}\x{1000})"
+ RenderBR {BR} at (34,32) size 0x0
+ RenderText {#text} at (0,36) size 46x18
+ text run at (0,36) width 46: "(\x{1000}\x{1000}\x{1000})"
+ RenderBR {BR} at (46,50) size 0x0
+ RenderText {#text} at (0,54) size 58x18
+ text run at (0,54) width 58: "(\x{1000}\x{1000}\x{1000}\x{1000})"
+ RenderBR {BR} at (58,68) size 0x0
--- /dev/null
+<p>
+ This tests that the Uniscribe code path renders missing glyphs as squares. It assumes that a Myanmar font is not available.
+</p>
+(က)<br>
+(ကက)<br>
+(ကကက)<br>
+(ကကကက)<br>
+2008-03-04 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ - fix <rdar://problem/5622336> Burmese text does not render on http://www.myanmarbible.com/bible/Judson/html/index.html
+
+ Test: platform/win/fast/text/uniscribe-missing-glyph.html
+
+ Note that default installations of Windows do not have Myanmar fonts.
+ What this patch does is ensure that the Myanmar and other complex
+ scripts are rendered as missing glyphs rather than not rendered at all.
+ The particular page in the bug measures the relative widths of two
+ rendered strings and, if they are rendered as missing glyphs, detects
+ that a Myanmar fonts is not available and substitutes the text with
+ images. By not rendering (and measuring) missing glyphs, WebKit was
+ throwing the page's detection code off.
+
+ * platform/graphics/win/UniscribeController.cpp:
+ (WebCore::UniscribeController::shape): Removed an early return in case
+ shaping resulted in missing glyphs. This is now expected if font
+ fallback failed to produce a font containing glyphs for the character.
+ Also changed two resize()s to shrink()s.
+
2008-03-04 Darin Adler <darin@apple.com>
Reviewed by Adam.
if (FAILED(shapeResult))
return false;
-
- // FIXME: We need to do better than this. Falling back on the entire item is not good enough.
- // We may still have missing glyphs even if we succeeded. We need to treat missing glyphs as
- // a failure so that we will fall back to another font.
- bool containsMissingGlyphs = false;
- SCRIPT_FONTPROPERTIES* fontProperties = fontData->scriptFontProperties();
- for (int i = 0; i < glyphCount; i++) {
- WORD glyph = glyphs[i];
- if (glyph == fontProperties->wgDefault) {
- containsMissingGlyphs = true;
- break;
- }
- }
-
- if (containsMissingGlyphs)
- return false;
- glyphs.resize(glyphCount);
- visualAttributes.resize(glyphCount);
+ glyphs.shrink(glyphCount);
+ visualAttributes.shrink(glyphCount);
return true;
}