diff options
| author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-08-27 11:43:55 +0200 |
|---|---|---|
| committer | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-09-16 21:05:57 +0200 |
| commit | 7a0c9f3d2828b7b9bbae9e1358f34332d3bdf943 (patch) | |
| tree | 1400dfa5c233c852b2d4f7f0365f63081753f616 | |
| parent | 40af385a1b7e7fdd60e3fb0adf872cc946515a06 (diff) | |
| download | qtwebkit-7a0c9f3d2828b7b9bbae9e1358f34332d3bdf943.tar.gz | |
Do not let platform font-engine handle zero-width spaces
WebCore has special handling of zero-width spacing, including using
a glyph with index 0 to represent it if the font doesn't have one. This
handling might get overridden by QRawFont::advancesForGlyphIndexes which
redoes advances for everything not marked as spaces.
This patch makes WebCore mark the zero-width spaces as spaces for
width iteration thereby handling it on the WebCore side instead of by
the platform font-engine.
Task-number: QTBUG-40912
Change-Id: Ida1711d3c65f1954273c786c902ef3ae77a72558
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
| -rw-r--r-- | Source/WebCore/platform/graphics/WidthIterator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/WidthIterator.cpp b/Source/WebCore/platform/graphics/WidthIterator.cpp index 48a59a27c..8e83544b7 100644 --- a/Source/WebCore/platform/graphics/WidthIterator.cpp +++ b/Source/WebCore/platform/graphics/WidthIterator.cpp @@ -265,7 +265,7 @@ inline unsigned WidthIterator::advanceInternal(TextIterator& textIterator, Glyph m_isAfterExpansion = false; } - if (shouldApplyFontTransforms() && glyphBuffer && Font::treatAsSpace(character)) + if (shouldApplyFontTransforms() && glyphBuffer && (Font::treatAsSpace(character) || Font::treatAsZeroWidthSpace(character))) charactersTreatedAsSpace.append(make_pair(glyphBuffer->size(), OriginalAdvancesForCharacterTreatedAsSpace(character == ' ', glyphBuffer->size() ? glyphBuffer->advanceAt(glyphBuffer->size() - 1).width() : 0, width))); |
