Chromium Code Reviews| Index: Source/platform/fonts/shaping/SimpleShaper.cpp |
| diff --git a/Source/platform/fonts/shaping/SimpleShaper.cpp b/Source/platform/fonts/shaping/SimpleShaper.cpp |
| index 24be19b9ee933caae0e3af3b62499483fc314198..1206d19a1ae991145a88e7e26e3e55e3fe36dfcc 100644 |
| --- a/Source/platform/fonts/shaping/SimpleShaper.cpp |
| +++ b/Source/platform/fonts/shaping/SimpleShaper.cpp |
| @@ -190,10 +190,12 @@ unsigned SimpleShaper::advanceInternal(TextIterator& textIterator, GlyphBuffer* |
| // Some fonts do not have a glyph for zero-width-space, |
| // in that case use the space character and override the width. |
| float width; |
| + bool spaceUsedAsZeroWidthSpace = false; |
| if (!glyphData.glyph && Character::treatAsZeroWidthSpaceInComplexScript(charData.character)) { |
| charData.character = space; |
| glyphData = glyphDataForCharacter(charData); |
| width = 0; |
| + spaceUsedAsZeroWidthSpace = true; |
| } else { |
| width = characterWidth(charData.character, glyphData); |
|
pdr.
2014/10/14 00:28:36
Would it make sense to add ASSERT(!fontData.isZero
eae
2014/10/14 00:30:36
Not really, we only go down the fallback-path abov
|
| } |
| @@ -207,7 +209,7 @@ unsigned SimpleShaper::advanceInternal(TextIterator& textIterator, GlyphBuffer* |
| cacheFallbackFont(fontData, primaryFont); |
| } |
| - if (hasExtraSpacing) |
| + if (hasExtraSpacing && !spaceUsedAsZeroWidthSpace) |
| width = adjustSpacing(width, charData, *fontData, glyphBuffer); |
| if (m_bounds) |