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

Change ParagraphBuilder to replace the parent style's font families with the...

Change ParagraphBuilder to replace the parent style's font families with the child style's font families (#10074)

Previously ParagraphBuilder was concatenating the child's fonts to the
parent's font list, causing the parent's fonts to take precedence.

Fixes https://github.com/flutter/flutter/issues/35992
上级 eb74f2ce
......@@ -438,8 +438,10 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded,
}
if (mask & tsFontFamilyMask) {
style.font_families.insert(style.font_families.end(), fontFamilies.begin(),
fontFamilies.end());
// The child style's font families override the parent's font families.
// If the child's fonts are not available, then the font collection will
// use the system fallback fonts (not the parent's fonts).
style.font_families = fontFamilies;
}
if (mask & tsFontFeaturesMask) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册