From de1e019d56d364315188d8f5fbb285e972f86eab Mon Sep 17 00:00:00 2001 From: Seigo Nonaka Date: Mon, 10 May 2021 00:37:40 -0700 Subject: [PATCH] Update usage of FontCollection interfaces. Bug: 187358499 Test: m Change-Id: I2b1f001b3ebf7c297dae422c730d7052894e4394 --- native/android/system_fonts.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/native/android/system_fonts.cpp b/native/android/system_fonts.cpp index 60b0f1eeaf72f..9fe792958cefa 100644 --- a/native/android/system_fonts.cpp +++ b/native/android/system_fonts.cpp @@ -329,7 +329,9 @@ AFont* _Nonnull AFontMatcher_match( static_cast(matcher->mFamilyVariant), 1 /* maxRun */); - const std::shared_ptr& font = runs[0].fakedFont.font; + const std::shared_ptr& font = + fc->getBestFont(minikin::U16StringPiece(text, textLength), runs[0], matcher->mFontStyle) + .font; std::unique_ptr result = std::make_unique(); const android::MinikinFontSkia* minikinFontSkia = reinterpret_cast(font->typeface().get());