- fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=10094
Japanese characters improperly rendering in TOT
Test: fast/encoding/denormalised-voiced-japanese-chars.html
* platform/Font.cpp:
(WebCore::WidthIterator::advance): pass currentCharacter to normalizeVoicingMarks
(WebCore::WidthIterator::normalizeVoicingMarks): turn the currentCharacter variable
into an argument as WidthIterator::advance doesn't update m_currentCharacter while
looping
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15651
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-07-27 Graham Dennis <graham.dennis@gmail.com>
+
+ Reviewed by Darin.
+
+ - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=10094
+ Japanese characters improperly rendering in TOT
+
+ * fast/encoding/denormalised-voiced-japanese-chars-expected.checksum: Added.
+ * fast/encoding/denormalised-voiced-japanese-chars-expected.png: Added.
+ * fast/encoding/denormalised-voiced-japanese-chars-expected.txt: Added.
+ * fast/encoding/denormalised-voiced-japanese-chars.html: Added.
+
2006-07-27 Eric Seidel <eric@eseidel.com>
Reviewed by ap.
--- /dev/null
+f0a4eab1483c813f357ac405e2e564b4
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x246
+ RenderBlock {HTML} at (0,0) size 800x246
+ RenderBody {BODY} at (8,8) size 784x222
+ RenderBlock (anonymous) at (0,0) size 784x54
+ RenderText {#text} at (0,0) size 775x54
+ text run at (0,0) width 775: "This test checks that the decomposed unicode version of voiced japanese hiragana and katakana characters are rendered the"
+ text run at (0,18) width 724: "same as the precomposed version. This test is a pixel-test, and passes when the text in the two heading elements are"
+ text run at (0,36) width 57: "identical."
+ RenderBlock {H2} at (0,73) size 784x28
+ RenderText {#text} at (0,0) size 168x28
+ text run at (0,0) width 168: "\x{30CF}\x{3099}\x{30CA}\x{30CA}\x{3068}\x{30CF}\x{309A}\x{30CA}\x{30DE}"
+ RenderBlock {P} at (0,120) size 784x18
+ RenderText {#text} at (0,0) size 164x18
+ text run at (0,0) width 164: "The above is decomposed"
+ RenderBlock {H2} at (0,157) size 784x28
+ RenderText {#text} at (0,0) size 168x28
+ text run at (0,0) width 168: "\x{30D0}\x{30CA}\x{30CA}\x{3068}\x{30D1}\x{30CA}\x{30DE}"
+ RenderBlock {P} at (0,204) size 784x18
+ RenderText {#text} at (0,0) size 169x18
+ text run at (0,0) width 169: "The above is precomposed"
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+</head>
+<body>
+This test checks that the decomposed unicode version of voiced japanese hiragana and katakana characters are rendered the same as the precomposed version. This test is a pixel-test, and passes when the text in the two heading elements are identical.
+<h2>バナナとパナマ</h2>
+<p>The above is decomposed</p>
+
+<h2>バナナとパナマ</h2>
+<p>The above is precomposed</p>
+
+</body>
+</html>
+2006-07-27 Graham Dennis <graham.dennis@gmail.com>
+
+ Reviewed by Darin.
+
+ - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=10094
+ Japanese characters improperly rendering in TOT
+
+ Test: fast/encoding/denormalised-voiced-japanese-chars.html
+
+ * platform/Font.cpp:
+ (WebCore::WidthIterator::advance): pass currentCharacter to normalizeVoicingMarks
+ (WebCore::WidthIterator::normalizeVoicingMarks): turn the currentCharacter variable
+ into an argument as WidthIterator::advance doesn't update m_currentCharacter while
+ looping
+
2006-07-27 Eric Seidel <eric@eseidel.com>
Reviewed by ap.
float m_finalRoundingWidth;
private:
- UChar32 normalizeVoicingMarks();
+ UChar32 normalizeVoicingMarks(int currentCharacter);
};
WidthIterator::WidthIterator(const Font* font, const TextRun& run, const TextStyle& style, const FontData* substituteFontData)
// Deal with Hiragana and Katakana voiced and semi-voiced syllables.
// Normalize into composed form, and then look for glyph with base + combined mark.
// Check above for character range to minimize performance impact.
- UChar32 normalized = normalizeVoicingMarks();
+ UChar32 normalized = normalizeVoicingMarks(currentCharacter);
if (normalized) {
c = normalized;
clusterLength = 2;
return !glyphBuffer->isEmpty();
}
-UChar32 WidthIterator::normalizeVoicingMarks()
+UChar32 WidthIterator::normalizeVoicingMarks(int currentCharacter)
{
- int currentCharacter = m_currentCharacter;
if (currentCharacter + 1 < m_end) {
if (u_getCombiningClass(m_run[currentCharacter + 1]) == HIRAGANA_KATAKANA_VOICING_MARKS) {
// Normalize into composed form using 3.2 rules.