79 Commits

Author SHA1 Message Date
Jason Simmons
d6dd5b10d9
Request slight hinting when rendering glyphs with Skia (#4307)
Fixes https://github.com/flutter/flutter/issues/12820
2017-11-01 11:47:09 -07:00
Jason Simmons
e1f08d998a libtxt: insert a placeholder paint record representing the font metrics of an empty run (#4272) 2017-10-24 14:35:02 -07:00
Jason Simmons
054a2cca35 libtxt: some cleanup (#4268)
* rename glyph_position_x to glyph_lines
* use round instead of roundf
* return a range start/end struct in Paragraph::GetWordBoundary
2017-10-23 17:18:00 -07:00
Jason Simmons
b942027083 libtxt: record metrics for each font used within a run (#4259) 2017-10-20 14:45:52 -07:00
Jason Simmons
c39124d07c libtxt: better accuracy for text justification (#4255)
* do not reset the justify offset after each run within a line
* track word start/end ranges relative to the start of the text instead of the line
2017-10-20 11:50:21 -07:00
P.Y. Laligand
6fcb45991d Move //dart to //third_party/dart. (#4245) 2017-10-19 01:20:38 -07:00
Jason Simmons
8a9034c0fd libtxt: handle newlines during invocation of the minikin line breaker (#4237)
minikin::LineBreaker does not convert newline characters into line breaks
in its output.  Previously libtxt's version of LineBreaker container a patch
that added a large width offset for a newline in order to force wrapping to
the next line.  This works if the offset exceeds the paragraph's width
constraint.  But if the paragraph is laid out with infinite width, then the
text after the newline will continue on the current output line.

This change separates the paragraph's text into newline delimited blocks and
feeds each block separately to the minikin LineBreaker.

Also, libtxt was breaking the input styled text runs at newline boundaries.
This is no longer necessary.
2017-10-18 14:14:02 -07:00
Jason Simmons
4ab4ace867 libtxt: make the min/max intrinsic width calculations match expectations of the framework (#4220)
maxIntrinsicWidth is the sum of the width of all lines in the input
(if the width were any smaller, the renderer might have to wrap a line)

minIntrinsicWidth is the maximum width of a word (if the paragraph were
any narrower, the renderer would have to truncate a word)
2017-10-16 15:31:15 -07:00
P.Y. Laligand
5fae5d52cf Allow the project to be mapped to a location other than //flutter. (#4203)
This is for Fuchsia where we would like it to be located at //third_party/flutter.
2017-10-13 17:00:58 -07:00
Jason Simmons
6f4eb92020 libtxt: support the use_test_font flag required by framework tests (#4216)
This registers a test font manager that maps all fonts to the Ahem font
2017-10-13 11:31:35 -07:00
Jason Simmons
248af2d5b6 Remove obsolete text_align header from the libtxt benchmarks (#4211) 2017-10-12 13:50:27 -07:00
Jason Simmons
b84e114b8b libtxt: fix some typos (#4206) 2017-10-12 11:51:50 -07:00
Jason Simmons
199620a57b libtxt: support right-to-left text (#4198) 2017-10-11 16:15:57 -07:00
Jason Simmons
f24987571a libtxt: refactoring of paragraph layout to improve text justification (#4178)
This changes Paragraph::Layout to iterate line-by-line through the text.
For each line, Layout scans for word boundaries and adds extra space between
words if the line is justified.
2017-10-06 15:46:27 -07:00
Brian Osman
6388e92880 Change to new SkFontMgr API (#4173)
* Change to new SkFontMgr API

These changes clarify ownership rules and work today. They will be
necessary once SK_SUPPORT_LEGACY_FONTMGR_API goes away.

* Fix spacing

* Formatting
2017-10-04 14:22:57 -04:00
Jason Simmons
414c3fe3df libtxt: handle characters encoded as multiple UTF-16 code units (#4165) 2017-10-02 17:11:38 -07:00
Jason Simmons
e3404b81a5 libtxt: implementation of GetRectsForRange that processes a line at a time (#4155) 2017-10-02 12:54:26 -07:00
Jason Simmons
8061df14e2 libtxt: search for fallback fonts that can match emoji and CJK characters (#4156) 2017-10-02 12:01:40 -07:00
Jason Simmons
86f95f08d9 libtxt: Remove postprocess_line and improve tracking of X offsets for glyphs and PaintRecords (#4153) 2017-09-28 17:46:25 -07:00
Jason Simmons
14bf515259 libtxt: remove redundant line_widths (#4152) 2017-09-28 16:01:48 -07:00
Jason Simmons
a7e14ea474 libtxt: refactor glyph position calculation (#4134)
* Remove padding values in line_heights and glyph_position_x.  Each value
  in glyph_position_x now represents an actual glyph in the layout.

* Remove code intended to handle extra characters beyond the end of the
  last line.  The LineBreaker should ensure that the end of the last run
  matches the end of the last line.

* Return the upstream/downstream affinity of the cursor position in
  GetGlyphPositionAtCoordinate.

* Account for the space at the end of a word wrapped line in
  GetGlyphPositionAtCoordinate / GetCoordinatesForGlyphPosition
2017-09-22 15:15:59 -07:00
Jason Simmons
e58c2dc335 Support ligatures in libtxt (#4119) 2017-09-19 10:07:17 -07:00
Michael Goderbauer
08961f8ec5 Format all c-like sources with clang-format (#4088)
* format

* license script adaptions

* updated licenses

* review comments
2017-09-12 15:36:20 -07:00
George Kulakowski
6502090278 Fix remaining ftl->fxl conversions (#4091)
* Fix remaining ftl->fxl conversions

The previous scripting pass at this did not account for objective c file endings

* Update tonic DEPS reference to the post-fxl version
2017-09-11 16:31:18 -07:00
George Kulakowski
3aa7522c11 Rename ftl to fxl in Fuchsia specific code (#4090) 2017-09-11 15:58:48 -07:00
Jason Simmons
19590d2e42 Enable the Skia subpixel text flag in libtxt (#4086)
This flag was set in the Blink renderer (see FontPlatformData::setupPaint)
2017-09-11 15:06:47 -07:00
Jason Simmons
fcb9147b70 Change the libtxt default text color to white in order to match RenderStyle::initialColor (#4074) 2017-09-07 14:17:29 -07:00
Chinmay Garde
354aeb9f3a Fix iOS simulator builds. (#4062) 2017-09-05 11:53:49 -07:00
Jason Simmons
c2e8a2e3ce Use a generic sans-serif font family on Android that will be recognized by Skia's font manager (#4055) 2017-09-01 16:09:47 -07:00
Jason Simmons
1c6433fab4 Ellipsizing implementation for libtxt (#4048) 2017-09-01 14:17:04 -07:00
Chinmay Garde
8b3e746442 Add per platform default font family detection. (#4053) 2017-09-01 14:10:15 -07:00
Chinmay Garde
a4e63a8add Fix the libTXT benchmarking target for API updates and compile on Mac. (#4049) 2017-09-01 12:27:35 -07:00
Chinmay Garde
a0f9084f48 Wire up support for multiple font managers in txt::FontCollection. (#4042) 2017-09-01 11:56:38 -07:00
Adam Barth
73554a1c32 Add //garnet (#4043)
This repository contains FTL now in the Fuchsia build.
2017-08-31 16:47:13 -07:00
Jason Simmons
f9e00a7c72 Revert "Re-enable Unicode ZWJ handling code that had been disabled pending an ICU update (#4035)" (#4036)
This reverts commit afd2e6b81883c110eb2d585b51ecfc871e8d8f1e.

Fuchsia is still using an older version of ICU that does not support this.

Also temporarily disable a unit test that failed without the reverted patch.
2017-08-29 12:53:25 -07:00
Jason Simmons
afd2e6b818 Re-enable Unicode ZWJ handling code that had been disabled pending an ICU update (#4035) 2017-08-29 11:47:58 -07:00
Chinmay Garde
f09e41c881 Remove manual checks for arguments correctly handled by u_hasBinaryProperty. (#4025)
After the DEPS updates, we use Unicode 9.0 and so these workarounds are not necessary. I re-ran all the EmojiTests to verify.
2017-08-28 13:49:40 -07:00
Chinmay Garde
c57d46f474 Avoid workarounds for old version of ICU and Harfbuzz. (#4024) 2017-08-28 13:28:09 -07:00
Chinmay Garde
66c7018a70 Add more tests from the Android Minikin test bench to the common test runner. (#4020)
This will allow us to use the common font fixtures.
2017-08-28 10:10:15 -07:00
Chinmay Garde
0be648264d Clang format the imported minikin sources, tests and benchmarks to match Flutter engine stylf. (#4018) 2017-08-25 17:43:47 -07:00
Chinmay Garde
aa0726f4a3 Create a unified target for the txt and minikin library, tests and benchmarks. (#4016) 2017-08-25 17:14:47 -07:00
Chinmay Garde
78a04ad75d Add 'third_party/txt/' from commit '130cc7e044a3ace1a70bbd71ce8ca4c72712ce9e'
git-subtree-dir: third_party/txt
git-subtree-mainline: 0f16f8ddeaeceb959cb9ac0fd1823e264758b252
git-subtree-split: 130cc7e044a3ace1a70bbd71ce8ca4c72712ce9e
2017-08-25 15:16:46 -07:00
Gary Qian
b449d6f494 Add emoji font and initial tests for emojis.
Change-Id: Ic9f4b3ded8d747004900ce296b5fb324d5c0da3a
2017-08-03 14:20:04 -07:00
Gary Qian
cea0b0a43f Use serif font on kerning tests and white bg for increased test clarity.
Change-Id: If9a0063d854a277ea3023e44558ee443602cf467
2017-08-01 16:48:33 -07:00
Gary Qian
b66dc2cb9e Add chinese tests, underline fix, cleanup, move fonts to
third_party/fonts.

Change-Id: I1b246534cd364c9e7e3fec3f6bcbe202932fee44
2017-07-06 12:25:48 -07:00
Adam Barth
22f834e048 Remove files that moved to buildroot 2016-08-09 13:51:42 -07:00
Adam Barth
17ebc33a61 Remove //third_party/ply (#2850)
We don't use this anymore.
2016-08-01 20:54:48 -07:00
Chinmay Garde
ace8307aab Asynchronous texture upload. (#2837) 2016-08-01 16:05:45 -07:00
Ian Hickson
e99cbb038e Tool for managing licenses. (#2822) 2016-07-26 13:10:57 -07:00
Chinmay Garde
8baa5615fe Remove third_party/mesa. (#2797) 2016-07-13 16:31:16 -07:00