| Index: Source/platform/fonts/WidthIterator.cpp
|
| diff --git a/Source/platform/fonts/WidthIterator.cpp b/Source/platform/fonts/WidthIterator.cpp
|
| index 8723a13836f98a5cc4e50433c37be96e2f08ac7f..db8f5fb71e851fba924c74681c70f66691f8e1eb 100644
|
| --- a/Source/platform/fonts/WidthIterator.cpp
|
| +++ b/Source/platform/fonts/WidthIterator.cpp
|
| @@ -188,14 +188,23 @@ unsigned WidthIterator::advanceInternal(TextIterator& textIterator, GlyphBuffer*
|
| while (textIterator.consume(charData.character, charData.clusterLength)) {
|
| charData.characterOffset = textIterator.currentCharacter();
|
|
|
| - const GlyphData glyphData = glyphDataForCharacter(charData, normalizeSpace);
|
| + GlyphData glyphData = glyphDataForCharacter(charData, normalizeSpace);
|
| +
|
| + // Some fonts do not have a glyph for zero-width-space,
|
| + // in that case use the space character and override the width.
|
| + float width;
|
| + if (!glyphData.glyph && Character::treatAsZeroWidthSpaceInComplexScript(charData.character)) {
|
| + charData.character = space;
|
| + glyphData = glyphDataForCharacter(charData);
|
| + width = 0;
|
| + } else {
|
| + width = characterWidth(charData.character, glyphData);
|
| + }
|
| +
|
| Glyph glyph = glyphData.glyph;
|
| const SimpleFontData* fontData = glyphData.fontData;
|
| ASSERT(fontData);
|
|
|
| - // Now that we have a glyph and font data, get its width.
|
| - float width = characterWidth(charData.character, glyphData);
|
| -
|
| if (m_fallbackFonts && lastFontData != fontData && width) {
|
| lastFontData = fontData;
|
| cacheFallbackFont(fontData, primaryFont);
|
|
|