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

Unified Diff: third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h

Issue 2924263003: [LayoutNG] Initial letter-spacing and word-spacing support (Closed)
Patch Set: Cleanup Created 3 years, 6 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
Index: third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h b/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h
index ec78526033c7a4fdae3d16ea685fcdfad268b76f..22b2ee35d7c43c2a0d3bcf8ea18a218cde32824d 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h
+++ b/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h
@@ -47,7 +47,7 @@ class PLATFORM_EXPORT CachingWordShapeIterator final {
: shape_cache_(cache),
text_run_(run),
font_(font),
- spacing_(run, font->GetFontDescription()),
+ spacing_(run),
width_so_far_(0),
start_index_(0) {
DCHECK(font);
@@ -56,6 +56,9 @@ class PLATFORM_EXPORT CachingWordShapeIterator final {
// use the cache or if the font doesn't support word by word shaping
// fall back on shaping the entire run.
shape_by_word_ = font_->CanShapeWordByWord();
+
+ if (!run.SpacingDisabled())
ikilpatrick 2017/06/29 16:17:59 Can you add a comment here as to why spacing might
+ spacing_.SetSpacingAndExpansion(font->GetFontDescription());
}
bool Next(RefPtr<const ShapeResult>* word_result) {
@@ -202,7 +205,7 @@ class PLATFORM_EXPORT CachingWordShapeIterator final {
ShapeCache* shape_cache_;
const TextRun& text_run_;
const Font* font_;
- ShapeResultSpacing spacing_;
+ ShapeResultSpacing<TextRun> spacing_;
float width_so_far_; // Used only when allowTabs()
unsigned start_index_ : 31;
unsigned shape_by_word_ : 1;

Powered by Google App Engine
This is Rietveld 408576698