未验证 提交 0535b5e7 编写于 作者: J Jason Simmons 提交者: GitHub

[SkParagraph] Copy font features to the Skia layout engine text style (#15562)

上级 fb526223
......@@ -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;
......
......@@ -40,4 +40,8 @@ std::string FontFeatures::GetFeatureSettings() const {
return stream.str();
}
const std::map<std::string, int>& FontFeatures::GetFontFeatures() const {
return feature_map_;
}
} // namespace txt
......@@ -31,6 +31,8 @@ class FontFeatures {
std::string GetFeatureSettings() const;
const std::map<std::string, int>& GetFontFeatures() const;
private:
std::map<std::string, int> feature_map_;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册