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
This converts the libtxt Paragraph and ParagraphBuilder classes into
interfaces with Minikin and SkShaper/SkParagraph based implementations.
Use the --enable-skshaper GN flag to select the Skia shaper implementation
at build time.
Corects a bnuch of typeos throughout teh engien codebsae. Also makes
a couple minor Commonwealth -> US spelling adjustments for consistency
with the rest of Flutter's codebase.
Made use of `misspell` tool:
https://github.com/client9/misspell
This mechanically replaces kXXX_SkTextEncoding with SkTextEncoding::kXXX
and kXXX_SkFontHinting with SkFontHinting::kXXX. This will allow Skia to
remove these old macro constants and get everyone on the new enums.
* Fix include paths in libtxt to prepare for upcoming Skia build change
Red test results are due to a different change. This PR fixes compile issues on the Skia side, and ensures that the next Skia -> Flutter roll can land properly.
If the mapping callback is not set or it the callback returns invalid data, ICU initialization will be embedder responsibility.
This affects all embedders and the following have been audited:
* Android: Via a symbol mapping.
* iOS: Via a file mapping.
* Embedder: Via a file mapping.
* Fuchsia: Via a VMO mapping
* Test shells and Flutter tester: Via file mapping with ICU data needing to be next to the executable.
currentLineWidth is the width passed into Paragraph layout, which comes
from the maxIntrinsicWidth returned by a previous call to Paragraph layout.
That width is calculated by Layout::measureText.
postBreak is calculated from the character widths in the LineBreaker.
A slight mismatch between these two widths may unnecessarily cause the
insertion of desperate breaks in addWordBreak. Adding some slack to
currentLineWidth works around this.
Fixes https://github.com/flutter/flutter/issues/30347