281 Commits

Author SHA1 Message Date
Jason Simmons bd322a69b0 [SkParagraph] Cache the font collection created for use by the Skia text shaper library (#15317) 2020-01-08 15:21:35 -08:00
Gary Qian f9a2fab7c0 Fix RectHeightStyle::kMax ascent computation bug (#15106) 2020-01-07 10:43:42 -08:00
Jason Simmons d6172fdcfa libtxt: cache fallback fonts found by a Minikin font collection (#14482)
If a new fallback font is discovered during paragraph layout, the fallback
font cache in txt::FontCollection will use that font in future layouts.

However, that cache is not available if the new fallback font needs to be
used for other characters within the current layout.  This PR adds a cache
to minikin::FontCollection and checks whether fonts in the cache can handle
a character before calling the fallback font provider.

See https://github.com/flutter/engine/pull/13257
2019-12-13 15:18:37 -08:00
Jason Simmons 76d264ee71 [SkParagraph] Convert the height override flag in text styles (#14283) 2019-12-10 13:40:54 -08:00
Jason Simmons bf99efe65b libtxt: pass an RTL bool flag instead of a bidiFlags enum to measureText (#13736)
Fixes https://github.com/flutter/flutter/issues/41086
2019-11-08 15:18:06 -08:00
Gary Qian 0928c1af2f Add 'Cough' test font and support multiple test fonts. (#13649) 2019-11-05 12:27:34 -08:00
Gary Qian 728e473f1a Pass LinearTextFlat to SkFont - iOS13 letter spacing (#13321) 2019-10-28 11:09:26 -07:00
Gary Qian 5061b61a9a Update harfbuzz to 2.6.2, Roll buildroot to a518e (#13242) 2019-10-22 15:18:36 -07:00
Gary Qian ee1a140fa9 Add utils to disable on mac/windows, disable invalid LibLxt tests on mac (#13189) 2019-10-16 16:43:31 -07:00
Chinmay Garde b6858d2092 Use the fixtures mechanism for txt unit-tests and benchmarks. (#13180)
These tests and benchmarks can now be run without needing additional flags on the command line.
2019-10-16 16:29:55 -07:00
Jason Simmons c710a981f4 Integrate more SkParagraph builder patches (#13094)
* ParagraphBuilderSkia::AddPlaceholder implementation
* StrutStyle height override
2019-10-14 11:17:11 -07:00
Jason Simmons ed3928087d Integration with more of Skia's SkShaper/SkParagraph APIs (#13008)
Based on https://github.com/Rusino/engine/tree/temp
2019-10-10 10:08:29 -07:00
Gary Qian 73c0397d4e Explain vertical font metrics and refactor UpdateLineMetrics. (#11795) 2019-10-02 18:08:48 -04:00
Gary Qian 075c5b0f61 Track fallback font names as a vector instead of a set. (#12426) 2019-09-24 20:10:40 -04:00
chunhtai aadd5a346b Add system font change listener for windows (#12276)
* Add windows font change logic

* update

* fix comment
2019-09-23 13:23:46 -07:00
Gary Qian 21b456d52b Check for index bounds in RTL handling for trailing whitespace runs. (#12336)
* Check for special case index out of bounds condition for leading space

* Add TODO

* Rework to pass tests

* More robust check for leading

* Minor adjustment

* Fix order bug

* Do not modify for leading space

* Fix test value

* Condition
2019-09-24 04:21:35 +08:00
Alexander Aprelev 1b63444390 Revert "Started taking advantage of Skia's new copyTableData to avoid (#10154)" (#12263)
This reverts commit 6beba539af as it breaks flutter on ios 32-bit devices.
2019-09-13 10:24:28 -07:00
gaaclarke 6beba539af Started taking advantage of Skia's new copyTableData to avoid (#10154)
superfluous copies.
2019-09-12 11:30:11 -07:00
Gary Qian e18298c973 Fix RTL justification alignment with newline (#11842) 2019-09-03 16:42:53 -07:00
Gary Qian 13ece5c7fc Update the ui.LineMetrics.height metric to be more useful to external users (#11456) 2019-08-28 12:26:42 -07:00
Brian Osman 193deaf670 Include <string> from font_asset_provider (#11622) 2019-08-28 10:20:03 -04:00
Gary Qian 9f1eab2f1f Expose LineMetrics in dart:ui (#10670) 2019-08-26 13:40:22 -07:00
Gary Qian a1fe6a6871 Reland "Track detailed LibTxt metrics with LineMetrics(#10127)" (#11064) 2019-08-22 16:00:45 -07:00
Jason Simmons dd0eecc2e0 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
2019-08-16 14:09:41 -07:00
Jason Simmons cdaf44265b Remove a tracing macro with a dangling pointer (#11002)
Fixes https://github.com/flutter/flutter/issues/38543
2019-08-14 12:40:14 -07:00