Index: third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.cpp |
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.cpp b/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.cpp |
index 92023e33591e1926460f8761450a772b7a6ad494..0945502746cfb37a993c7002f66fa4ccaf37a2e5 100644 |
--- a/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.cpp |
+++ b/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.cpp |
@@ -116,4 +116,20 @@ CharacterRange CachingWordShaper::getCharacterRange(const Font* font, |
return buffer.getCharacterRange(run.direction(), totalWidth, from, to); |
} |
+Vector<CharacterRange> CachingWordShaper::individualCharacterRanges( |
+ const Font* font, const TextRun& run, unsigned from, unsigned to) |
+{ |
+ ShapeResultBuffer buffer; |
+ float totalWidth = shapeResultsForRun(m_shapeCache, font, run, nullptr, |
+ &buffer); |
+ |
+ Vector<CharacterRange> allExtents; |
+ for (unsigned position = from; position <= to; position++) { |
+ allExtents.append(buffer.getCharacterRange(run.direction(), totalWidth, |
+ position, position + 1)); |
+ } |
+ |
+ return allExtents; |
+} |
+ |
}; // namespace blink |