diff --git a/engine/src/flutter/third_party/txt/src/skia/paragraph_builder_skia.cc b/engine/src/flutter/third_party/txt/src/skia/paragraph_builder_skia.cc index cc56504c59..1b3dedb547 100644 --- a/engine/src/flutter/third_party/txt/src/skia/paragraph_builder_skia.cc +++ b/engine/src/flutter/third_party/txt/src/skia/paragraph_builder_skia.cc @@ -114,6 +114,11 @@ skt::TextStyle TxtToSkia(const TextStyle& txt) { skia.setForegroundColor(txt.foreground); } + skia.resetFontFeatures(); + for (const auto& ff : txt.font_features.GetFontFeatures()) { + skia.addFontFeature(SkString(ff.first.c_str()), ff.second); + } + skia.resetShadows(); for (const txt::TextShadow& txt_shadow : txt.text_shadows) { skt::TextShadow shadow; diff --git a/engine/src/flutter/third_party/txt/src/txt/font_features.cc b/engine/src/flutter/third_party/txt/src/txt/font_features.cc index c7eb46c9d9..0729a035aa 100644 --- a/engine/src/flutter/third_party/txt/src/txt/font_features.cc +++ b/engine/src/flutter/third_party/txt/src/txt/font_features.cc @@ -40,4 +40,8 @@ std::string FontFeatures::GetFeatureSettings() const { return stream.str(); } +const std::map& FontFeatures::GetFontFeatures() const { + return feature_map_; +} + } // namespace txt diff --git a/engine/src/flutter/third_party/txt/src/txt/font_features.h b/engine/src/flutter/third_party/txt/src/txt/font_features.h index 46dc9dfc3a..ca5fe7df41 100644 --- a/engine/src/flutter/third_party/txt/src/txt/font_features.h +++ b/engine/src/flutter/third_party/txt/src/txt/font_features.h @@ -31,6 +31,8 @@ class FontFeatures { std::string GetFeatureSettings() const; + const std::map& GetFontFeatures() const; + private: std::map feature_map_; };