Changeset 148283 in webkit


Ignore:
Timestamp:
Apr 12, 2013 9:54:01 AM (11 years ago)
Author:
rniwa@webkit.org
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r148282 r148283  
     12013-04-12  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        [Mac] Some ligatures are applied across different fronts
     4        https://bugs.webkit.org/show_bug.cgi?id=113604
     5
     6        Reviewed by Darin Adler.
     7
     8        The bug was caused by applyFontTransforms applying ligatures without updating the font data in the glyph buffer.
     9
     10        Suppose we have characters AB and A uses font X and B uses font Y. Further suppose that we have ligatures for AB
     11        in Y. The problem was that WithIterator::advanceInternal calls applyFontTransforms on AB to apply this ligature
     12        even though A and B use different fonts. Since X doesn't contain the same ligature for A to be paired with that
     13        of B in X, we get a blank A.
     14
     15        Fixed the bug by resetting lastGlyphCount after calling applyFontTransforms. This ensures that we don't call
     16        applyFontTransforms across different fonts.
     17
     18        No new tests since this requires a variant of Osaka font that doesn't come with OS X.
     19
     20        The bug 114482 tracks the effort to add a test for this bug fix. I've already asked someone to create a custom
     21        font for us so that we can test this bug fix but that's going to a while.
     22
     23        * platform/graphics/WidthIterator.cpp:
     24        (WebCore::WidthIterator::advanceInternal):
     25
    1262013-04-12  Ryosuke Niwa  <rniwa@webkit.org>
    227
  • trunk/Source/WebCore/platform/graphics/WidthIterator.cpp

    r137786 r148283  
    190190
    191191        if (fontData != lastFontData && width) {
    192             if (shouldApplyFontTransforms())
     192            if (shouldApplyFontTransforms()) {
    193193                m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, lastFontData, m_typesettingFeatures, charactersTreatedAsSpace);
     194                lastGlyphCount = glyphBuffer->size(); // applyFontTransforms doesn't update when there had been only one glyph.
     195            }
    194196
    195197            lastFontData = fontData;
Note: See TracChangeset for help on using the changeset viewer.