This will improve font matching in SkParagraph for fonts that are bundled as
assets within the app. Libtxt was using Minikin's FontFamily class to select
the closest matching font, but SkParagraph will rely on the matchStyle
implementation in the asset font manager.
This exposes the line boundary information a line by adding getLineBoundary to return the indices corresponding to a line around a TextPosition. The information is already calculated when calculating line metrics, so that we can enable moving the selection/cursor to the beginning/end of a line in a text field.
This was required by the C++ spec pre-C++11 and still gets picked up in
the Fuchsia tree due to -Wnewline-eof. It fixes:
../../third_party/flutter/lib/ui/text/line_metrics.h:75:47: error: no newline at end of file [-Werror,-Wnewline-eof]
#endif // FLUTTER_LIB_UI_TEXT_LINE_METRICS_H_
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 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.
Some components in the Flutter engine were derived from the forked blink codebase. While the forked components have either been removed or rewritten, the use of the blink namespace has mostly (and inconsistently) remained. This renames the blink namesapce to flutter for consistency. There are no functional changes in this patch.
The font manager returned by SkFontMgr::RefDefault is determined by Skia's
build configuration flags. Embedders may want to use a default font manager
other than the one selected by their build of Skia.
* Support user-provided font-fallback.
* Use tonic to pass to native
* Handle font families as a fallback vector in LibTxt
* Fix docs
* Concatentate fontFamily lists in dart before passing to engine
* Fix formatting
* Reworked font family matching to search all managers
* Fix formatting
* Proper toString null checking to keep format consistent
* Formatting
* Move _listEquals out of textstyle as it is not specific to TextStyle and will later be used for paragraphStyle too
Skia is moving ports/SkFontMgr.h to core/SkFontMgr.h. The existing
ports/SkFontMgr.h is now just a forwarding header to keep users working
through the transition. Update includes to point to the new location.
Previously the engine would load all embedded fonts listed in the app's
font manifest during startup. This change creates a Skia font manager that
is backed by the engine's AssetManager and can load embedded font assets
on demand.