diff --git a/third_party/txt/src/skia/paragraph_builder_skia.cc b/third_party/txt/src/skia/paragraph_builder_skia.cc index cc56504c590a175c2c2c5f1f5eee0b2a229198bb..1b3dedb5474c1c7cd64c66c5ef213a5954bb510e 100644 --- a/third_party/txt/src/skia/paragraph_builder_skia.cc +++ b/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/third_party/txt/src/txt/font_features.cc b/third_party/txt/src/txt/font_features.cc index c7eb46c9d9fb81a2d59e65f60d2b2821ef544bb5..0729a035aa9fbe5cbb732884fd04ac3474508357 100644 --- a/third_party/txt/src/txt/font_features.cc +++ b/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/third_party/txt/src/txt/font_features.h b/third_party/txt/src/txt/font_features.h index 46dc9dfc3a0cf2d83614273c8e9b0d39413dee1a..ca5fe7df41823d888f5d03d04cf10cd9ff398162 100644 --- a/third_party/txt/src/txt/font_features.h +++ b/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_; };