Commit ee54c4da authored by rniwa@webkit.org's avatar rniwa@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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148283 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ebea09c0
2013-04-12 Ryosuke Niwa <rniwa@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 <rniwa@webkit.org>
[Mac] Enable spellchecking tests added in r141471
......@@ -189,8 +189,10 @@ inline unsigned WidthIterator::advanceInternal(TextIterator& textIterator, Glyph
}
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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment