259 Commits

Author SHA1 Message Date
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
Dan Field
da352d0f72
Revert "Track detailed LibTxt metrics with LineMetrics(#10127)" (#10982)
This reverts commit 8682aaf4cd051fe46023fd82b41dd751b7f4ae7f.
2019-08-13 13:26:32 -07:00
Gary Qian
8682aaf4cd
Track detailed LibTxt metrics with LineMetrics(#10127) 2019-08-02 13:03:23 -07:00
Gary Qian
30c202a68d
Fix run.start -> run_start (#10295) 2019-07-31 14:07:56 -07:00
Jason Simmons
f742514a56
Cache font family lookups that fail to obtain a font collection (#10109) 2019-07-24 11:33:04 -07:00
Gary Qian
3c76b90b25
Track clusters and return cluster boundaries in getGlyphPositionForCoordinates (emoji fix) (#10063) 2019-07-23 16:44:30 -07:00
Gary Qian
dd06cda54b
Fix justify for RTL paragraphs. (#9859) 2019-07-17 13:55:43 -07:00
Jason Simmons
b22410ef6b
Include SkParagraph headers only when the enable-skshaper flag is on (#9758)
These headers are currently causing errors in MSVC-based Windows builds.
2019-07-10 16:32:02 -07:00
Jason Simmons
2cd650d269
Minimal integration with the Skia text shaper module (#9556)
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.
2019-07-10 14:13:55 -07:00
Chinmay Garde
f600ae830d
Use libc++ variant of string view and remove the FML variant. (#9737) 2019-07-10 12:11:39 -07:00
Jason Simmons
b453d3c3dd
libtxt: fix reference counting of SkFontStyleSets held by font asset providers (#9561) 2019-07-10 12:08:15 -07:00
Gary Qian
75387dbc14
TextStyle.height property as a multiple of font size instead of multiple of ascent+descent+leading. (#9041) 2019-07-08 15:32:02 -07:00
Gary Qian
185087a65f
Manually draw remainder curve for wavy decorations (#9468) 2019-06-27 10:33:13 -07:00
Gary Qian
8591bd32e6
Handle ambiguous directionality of final trailing whitespace in mixed bidi text (#9489) 2019-06-26 15:08:36 -07:00
Jason Simmons
b188479981
Remove variants of ParagraphBuilder::AddText that are not used within the engine (#9403) 2019-06-24 12:41:01 -07:00
Jason Simmons
14c3c79f57
libtxt: remove obsolete font_manager_available defines (#9376) 2019-06-20 11:04:59 -07:00
Chinmay Garde
96a1a843cb
Replace lock_guard with scoped_lock and use class template argument deduction. (#9338) 2019-06-17 10:08:45 -07:00
Gary Qian
c5c0da1bfd
Build txt_benchmarks, make benches compile again (#9330) 2019-06-14 17:20:44 -07:00
Chinmay Garde
54ff3c5183
Avoid using std::unary_function (#9314) 2019-06-13 12:56:54 -07:00
Zachary Anderson
0a2e28d797
Revert tracing changes (#9296)
* Revert "[fuchsia] Fix alignment of Fuchsia/non-Fuchsia tracing (#9289)"

This reverts commit f80ac5f571479053b134e60bca77603269b2ce2a.

* Revert "Align fuchsia and non-fuchsia tracing (#9199)"

This reverts commit 78265484623037c6544dfd5380367bca29fa27b0.
2019-06-12 10:25:49 -07:00
Gary Qian
3371da1e09
Add platform_fuchsia.cc for default font on fuchsia (#9204) 2019-06-05 16:01:58 -07:00
Dan Field
7826548462
Align fuchsia and non-fuchsia tracing (#9199) 2019-06-05 15:14:27 -07:00
Gary Qian
a4abfb2333
Text inline widget LibTxt/dart:ui implementation (#8207) 2019-06-03 10:32:46 -07:00
Gary Qian
0932008480
Remove outdated TODOs (#9114) 2019-05-28 17:06:57 -07:00
Chris Bracken
a44cbbf492
Delete BSDiff sources (#9086)
BSDiff is no longer used as of flutter/engine#8663. This removes the
unused Java import and sources.
2019-05-25 13:49:28 -07:00
Chris Bracken
0f1ff3bdb3
Correct typos, adopt US spellings (#9081)
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
2019-05-25 13:14:46 -07:00
Jason Simmons
82ccba3030
libtxt: have GetRectsForRange(strut) fall back to tight bounds if layout isn't forcing use of the strut (#9058) 2019-05-22 13:57:59 -07:00
Jason Simmons
135a140591
Add font features (such as tabular numbers) as an option in text styles (#8823)
Fixes https://github.com/flutter/flutter/issues/31691
2019-05-21 16:47:57 -07:00
Jason Simmons
424940f171
Add support for the Fontconfig-based Skia font manager (#8977) 2019-05-16 15:22:22 -07:00
Jason Simmons
aa63f090fd
libtxt: add a BoxHeightStyle option based on the height of the strut (#8927)
See https://github.com/flutter/flutter/issues/32332
2019-05-16 11:17:20 -07:00
Chinmay Garde
5ac2d02645
Avoid disabling sources assignment filters are these have been removed. (#8954) 2019-05-13 18:38:28 -07:00
bungeman
f4d23ef694 Replace Skia font macros with enums. (#8920)
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.
2019-05-13 11:11:49 -07:00
Gary Qian
3822aeccd9
Prevent redundant layouts when floor(width) is the same (#8867) 2019-05-10 09:58:53 -07:00
Dan Field
7ce2666e54
Guard Android logs (#8824) 2019-05-03 14:32:29 -07:00
Justin McCandless
3493dcfbae
Rename tightWidth to longestLine (#8706)
Renaming a brand new and unused parameter due to some discussion about connecting with the framework.
2019-04-26 16:06:12 -07:00
Brian Osman
e4c439d370
Fix include paths in libtxt to prepare for upcoming Skia build change (#8723)
* 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.
2019-04-24 13:50:21 -04:00
Gary Qian
ea28bfa13e
Custom RTL handling for ghost runs, NotoNaskhArabic test font (#8683)
Relands #8638
2019-04-22 11:09:43 -07:00
liyuqian
1c9457cedc
Revert "Only allow mappings for ICU initialization. (#8656)" (#8682)
This reverts commit bd8c5b135e4d41842d0d5d42ff4943a18b8f4f0c.

Reverts flutter/engine#8656

Reason:  https://github.com/flutter/engine/pull/8656 seems to break the framework windows tests and the engine roll (see https://cirrus-ci.com/task/4704667236827136 and https://github.com/flutter/flutter/pull/31330). The failure has been consistent for 7 consecutive engine-to-framework auto-rolls.

TBR: @chinmaygarde
2019-04-22 10:28:54 -07:00
liyuqian
b4ed3039fa
Revert "RTL handling for ghost runs, NotoNaskhArabic test font (#8638)" (#8681)
This reverts commit 6e79dcd0cfd9df08b4240a5aa158659c34e4154f.

Reverts flutter/engine#8638

Reason: flutter/engine#8638 breaks the post-submit Cirrus tests. See https://cirrus-ci.com/build/5143341531398144 and subsequent post-submit failures. Specifically, ParagraphTest.RightAlignParagraph is failing.

TBR: @GaryQian
2019-04-22 10:18:32 -07:00
Gary Qian
6e79dcd0cf
RTL handling for ghost runs, NotoNaskhArabic test font (#8638) 2019-04-21 00:30:53 -07:00
Chinmay Garde
bd8c5b135e
Only allow mappings for ICU initialization. (#8656)
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.
2019-04-19 15:01:40 -07:00
Jason Simmons
4b9966f5cb
Add an adjustment to the line width check in LineBreaker::addWordBreak (#8623)
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
2019-04-18 09:44:22 -07:00
Justin McCandless
a144f17aee
Tight Paragraph Width (#8530)
Calculate and expose paragraph tightWidth to the framework to allow drawing Text based on this.
2019-04-18 09:08:41 -07:00
Justin McCandless
06fea14e58
Glitchiness with Tab Characters (#8591)
Fix a bug that caused jumping and flashing when entering tab characters into a TextField.
2019-04-18 08:16:07 -07:00
Chris Bracken
82e6d68994
Eliminate unused write to local (#8541)
In GraphemeBreak::isGraphemeBreak() p0 is never read and
tailoredGraphemeClusterBreak() has no side-effects, so the call can be
eliminated.
2019-04-11 09:59:20 -07:00
Zachary Anderson
c00364a6c8
[font_collection] Add missing semicolon (#8546) 2019-04-11 09:45:24 -07:00
liyuqian
9bfa96dee9
Add trace events for creating minikin fonts (#8477)
Creating fonts can take a long time (50ms+) during frame build in the UI
thread.  Trace them to help us understand when it's causing a jank.
2019-04-09 10:21:12 -07:00
Zachary Anderson
efbecd7e8e
[txt] Add back FontCollection::SetDefaultFontManager (#8410) 2019-04-02 10:22:12 -07:00