Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2564)

Unified Diff: Source/platform/fonts/shaping/SimpleShaper.cpp

Issue 648293003: Handle missing glyphs when adjusting spacing in SimpleShaper (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/text/soft-hyphen-simple-text-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « LayoutTests/fast/text/soft-hyphen-simple-text-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698