From 87a0a529412409b399efd3e5a3aba40f2b2657cd Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 20 Oct 2017 14:45:52 -0700 Subject: [PATCH] libtxt: record metrics for each font used within a run (flutter/engine#4259) --- .../src/flutter/third_party/txt/src/txt/paragraph.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/engine/src/flutter/third_party/txt/src/txt/paragraph.cc b/engine/src/flutter/third_party/txt/src/txt/paragraph.cc index 63f6954815c..e488a5c665a 100644 --- a/engine/src/flutter/third_party/txt/src/txt/paragraph.cc +++ b/engine/src/flutter/third_party/txt/src/txt/paragraph.cc @@ -462,13 +462,14 @@ void Paragraph::Layout(double width, bool force) { } } } + + SkPaint::FontMetrics metrics; + paint.getFontMetrics(&metrics); + paint_records.emplace_back(run.style, SkPoint::Make(run_x_offset, 0), + builder.make(), metrics, line_number, + layout.getAdvance()); } - SkPaint::FontMetrics metrics; - paint.getFontMetrics(&metrics); - paint_records.emplace_back(run.style, SkPoint::Make(run_x_offset, 0), - builder.make(), metrics, line_number, - layout.getAdvance()); run_x_offset += layout.getAdvance(); }