mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Change ParagraphBuilder to replace the parent style's font families with the child style's font families (flutter/engine#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
This commit is contained in:
parent
99a3e1a60f
commit
4e67ab7b5f
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user