Title: [148283] trunk/Source/WebCore
Revision
148283
Author
rn...@webkit.org
Date
2013-04-12 09:54:01 -0700 (Fri, 12 Apr 2013)

Log Message

[Mac] Some ligatures are applied across different fronts
https://bugs.webkit.org/show_bug.cgi?id=113604

Reviewed by Darin Adler.

The bug was caused by applyFontTransforms applying ligatures without updating the font data in the glyph buffer.

Suppose we have characters AB and A uses font X and B uses font Y. Further suppose that we have ligatures for AB
in Y. The problem was that WithIterator::advanceInternal calls applyFontTransforms on AB to apply this ligature
even though A and B use different fonts. Since X doesn't contain the same ligature for A to be paired with that
of B in X, we get a blank A.

Fixed the bug by resetting lastGlyphCount after calling applyFontTransforms. This ensures that we don't call
applyFontTransforms across different fonts.

No new tests since this requires a variant of Osaka font that doesn't come with OS X.

The bug 114482 tracks the effort to add a test for this bug fix. I've already asked someone to create a custom
font for us so that we can test this bug fix but that's going to a while.

* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advanceInternal):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (148282 => 148283)


--- trunk/Source/WebCore/ChangeLog	2013-04-12 16:52:38 UTC (rev 148282)
+++ trunk/Source/WebCore/ChangeLog	2013-04-12 16:54:01 UTC (rev 148283)
@@ -1,5 +1,30 @@
 2013-04-12  Ryosuke Niwa  <rn...@webkit.org>
 
+        [Mac] Some ligatures are applied across different fronts
+        https://bugs.webkit.org/show_bug.cgi?id=113604
+
+        Reviewed by Darin Adler.
+
+        The bug was caused by applyFontTransforms applying ligatures without updating the font data in the glyph buffer.
+
+        Suppose we have characters AB and A uses font X and B uses font Y. Further suppose that we have ligatures for AB
+        in Y. The problem was that WithIterator::advanceInternal calls applyFontTransforms on AB to apply this ligature
+        even though A and B use different fonts. Since X doesn't contain the same ligature for A to be paired with that
+        of B in X, we get a blank A.
+
+        Fixed the bug by resetting lastGlyphCount after calling applyFontTransforms. This ensures that we don't call
+        applyFontTransforms across different fonts.
+
+        No new tests since this requires a variant of Osaka font that doesn't come with OS X.
+
+        The bug 114482 tracks the effort to add a test for this bug fix. I've already asked someone to create a custom
+        font for us so that we can test this bug fix but that's going to a while.
+
+        * platform/graphics/WidthIterator.cpp:
+        (WebCore::WidthIterator::advanceInternal):
+
+2013-04-12  Ryosuke Niwa  <rn...@webkit.org>
+
         [Mac] Enable spellchecking tests added in r141471
         https://bugs.webkit.org/show_bug.cgi?id=108525
 

Modified: trunk/Source/WebCore/platform/graphics/WidthIterator.cpp (148282 => 148283)


--- trunk/Source/WebCore/platform/graphics/WidthIterator.cpp	2013-04-12 16:52:38 UTC (rev 148282)
+++ trunk/Source/WebCore/platform/graphics/WidthIterator.cpp	2013-04-12 16:54:01 UTC (rev 148283)
@@ -189,8 +189,10 @@
         }
 
         if (fontData != lastFontData && width) {
-            if (shouldApplyFontTransforms())
+            if (shouldApplyFontTransforms()) {
                 m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, lastFontData, m_typesettingFeatures, charactersTreatedAsSpace);
+                lastGlyphCount = glyphBuffer->size(); // applyFontTransforms doesn't update when there had been only one glyph.
+            }
 
             lastFontData = fontData;
             if (m_fallbackFonts && fontData != primaryFont) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to