Sort the Skia typefaces in a font style set into a consistent order (#11056)
When Minikin searches for a font based on a font style, it will score the fonts in the family and choose the best match. However, multiple fonts may have equal scores (e.g. searching for a font with weight 600 when the set includes fonts with weights 500 and 700). In this case Minikin will select the first font in the list with the best score. However, the fonts in a font family's SkFontStyleSet may not always be provided in a consistent order by the SkFontMgr. So if the minikin::FontFamily list is populated based on the SkFontStyleSet order, then a query for a given style might not always return the same font. This change sorts the typefaces in the SkFontStyleSet before converting them into a Minikin font family. Fixes https://github.com/flutter/flutter/issues/31212
Showing
想要评论请 注册 或 登录