Commit Graph

465 Commits

Author SHA1 Message Date
Gary Qian
76d250550b Reset breaker after every layout to handle different widths.
Change-Id: I786c4c42b4db9418f4f802b4cbb70a051b35925a
2017-08-07 16:18:52 -07:00
Gary Qian
1046161c3e Save txt unittest snapshots in own folder to declutter.
Change-Id: Id51b88ced443c58c5cccdc666fa1d412845a5469
2017-08-07 12:13:03 -07:00
Gary Qian
39f8a13f4d Break on hyphens without minikin::Hyphenator, tests.
Change-Id: I42e449134ac8c007ffa07d7f56a8c56a26ec47a5
2017-08-07 11:20:50 -07:00
Gary Qian
4868e24e0e Separate handling of letterspace/advance to fix multi-run text jitter, temp disable ligatures.
Change-Id: Ia33b105fe8dc968cdcb365501842b4595b6e7922
2017-08-07 11:20:50 -07:00
Gary Qian
df6a3d6d26 Workaround for jittering text selection bug using LinearTextFlag.
Change-Id: I15d9b43e7d3de851c7eb40e2c4abf29adb2b4817
2017-08-04 12:26:31 -07:00
Gary Qian
530fa386b0 Add emoji font and initial tests for emojis.
Change-Id: Ic9f4b3ded8d747004900ce296b5fb324d5c0da3a
2017-08-03 14:20:04 -07:00
Gary Qian
a5fbb98ddd Fix incorrect/rounded glyph advances, update tests to reflect correct layout.
Change-Id: I15f441d065a2990decc433f9a9f8a74c452928c3
2017-08-03 12:43:10 -07:00
Gary Qian
3ba1087025 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
4a5e0222a3 Change handling of large y coord in GetGlyphPositionAtCoordinate() to match blink.
Change-Id: I6db6d5e98a0ef63e29cc4aac9a3aa38dfb18e59d
2017-08-01 16:48:33 -07:00
Gary Qian
a28fbd2e74 Correct name of def font on Android and fix bug with coords-to-glyphpos method.
Change-Id: Ib9d2a0a1a54f14c4725e47e00fb547df0a91cd40
2017-08-01 16:48:33 -07:00
Gary Qian
1fd69f9824 Refactor FontCollection to allow for adding in new font managers, and initial android font loading.
Change-Id: I719b14a515aabf5d6b3894f79ca64ea20ef5625d
2017-08-01 16:48:33 -07:00
Gary Qian
d09bbdfd37 Check if width is different before skipping Layout().
Change-Id: Ie5a99f39cf462c42ed1e484afc90a61e7567bdc3
2017-07-27 17:54:27 -07:00
Gary Qian
95bda714a0 Support handling '\n' characters.
Change-Id: I9d8c25df97e600ee3679f0bf31b0a4bb8df9eb6d
2017-07-27 13:44:19 -07:00
Gary Qian
8a5babb292 Custom width tracking for accurate and consistent underlines and decorations.
Change-Id: I8ea703321cefc5cc402bf6d4247cd45eb3e085b2
2017-07-27 09:58:41 -07:00
Gary Qian
476860da54 Default decoration color to text color.
Change-Id: I74f1ffc6372ccf952232e9dcbba66029c31a7088
2017-07-27 09:57:59 -07:00
Gary Qian
d447e4de83 Make decorations respect proper SkPaint::FontMetrics positioning and
thickness and improve overall decoration visual quality.

Change-Id: Icb5e64a80fbe8a04106125c2dc41e60459b944c0
2017-07-27 09:57:59 -07:00
Gary Qian
e2c9992638 API comments and reorder vars.
Change-Id: I9f73047bc5ad453b05083f019623f553d13bbba4
2017-07-27 09:57:46 -07:00
Gary Qian
1946e649c7 Add middle-of-glyph bounding for coord-to-index system and fix alignment bug.
Change-Id: I1f772886949131468407bdc12f1dc6e0ba03b68e
2017-07-25 15:40:09 -07:00
Gary Qian
a537b6cea6 Fix coord to glyph position function and glyph position tracking.
Change-Id: Ib031e9c46b5622a5ff830b602c1fa2fe037ea7f5
2017-07-25 12:31:36 -07:00
Gary Qian
13af3dc89c Add basecase checking to prevent segfault in GetWordBoundary().
Change-Id: I5ca93c0c15ef5dd3dbc6a5937f8b21338acf884d
2017-07-24 18:24:55 -07:00
Gary Qian
20914d0e91 Fix GetCoordinatesForGlyphPosition() and adjust other methods to match. Tests to back it up.
Change-Id: I2ea9065f043c752bebc1a16e1e0c2c2fec59d87c
2017-07-24 16:36:25 -07:00
Gary Qian
1ccc959d00 Add unittests for kerning.
Change-Id: I494bbd3993cde76cabc9dfc042dcee4b0fb6af4d
2017-07-24 15:24:35 -07:00
Gary Qian
34dfd6c602 Add support for multiple break strategies to better support edge case situations.
Change-Id: I61fc4d95a57b34f59073e99ad834c9a0d7ec7c76
2017-07-21 16:19:44 -07:00
Gary Qian
09d3505e3b Switch to using minikin letter spacing.
Change-Id: I0e0908eea3f79bf0a6a5eb9842956d4077bb9dd3
2017-07-21 12:08:17 -07:00
Gary Qian
1fca345a77 Benchmark improvements and additions. Document n^2 benchmark findings.
Change-Id: I697acad51082151e6614abffe6bebbbe73f31a75
2017-07-20 16:50:18 -07:00
Gary Qian
264a66f3f3 Do not pass full buffer to minikin for big performance improvements.
Change-Id: I411d6168e45204774d4776aa241feeaf19dad818
2017-07-20 13:10:35 -07:00
Gary Qian
85bd669eac Benchmark rework to better reflect real usage and slight performance improvements.
Change-Id: I3979c725ff9058fc208626ffb5fce95c2e03ac19
2017-07-20 12:19:57 -07:00
Gary Qian
4025267537 Use SkCanvasAutoRestore.
Change-Id: I35a7c65303e17132af86f552a657d226d9576850
2017-07-19 17:50:22 -07:00
Gary Qian
61418fd845 Align GetRectsForRange, GetCoords..., GetGlyphPos..., and GetWordBoundary with Blink results.
Change-Id: I9f4e30d1f0a35ca0b2fc2a38492670e58ba0fad7
2017-07-19 12:22:54 -07:00
Gary Qian
570ccc49f4 Support text alignment in decorations, other decorations fixes, satistics fixes.
Change-Id: I4b9537b040c4d729e895e85487c8e98e1ac7ef78
2017-07-19 12:22:54 -07:00
Gary Qian
69b2d8180a Min and Max Intrinsic Widths look mostly correct now.
Change-Id: I0201c88bab4a46baf5164def8cccd51f4c5486c1
2017-07-18 15:19:09 -07:00
Gary Qian
1a68f70b47 Setup methods and variables to accommodate actual intrinsic width algorithms.
Change-Id: I7295a970488052f9b471617518afd7a757d8f5c0
2017-07-14 18:26:03 -07:00
Gary Qian
13f2e067c6 Use source_set instead of static_library, fix a segfault crash, and fix
text positioning.

Change-Id: I1bc5f1076c25a757aa8550732a4ae0c4fc36b127
2017-07-14 10:55:43 -07:00
Gary Qian
18ed4e65c9 Rework the height and spacing, add comments.
Change-Id: I5ad517b0e1aa3938da63c4069880768477b788ac
2017-07-13 10:42:24 -07:00
Gary Qian
8c0962d728 Fix/enable proper font weight selection.
Change-Id: I3cd1eb7758708d90a6c99384cb336c65c1e5c5c3
2017-07-12 17:11:39 -07:00
Gary Qian
97e0ba1bdf Fix crash bug and add spacing tests.
Change-Id: Idc3eaeaf6ff6230ea6b804b3d4ed8819eb5a7a7d
2017-07-12 14:55:58 -07:00
Gary Qian
967e80b96c Fix and smooth justifications to properly handle ligatures with whitespace mapping.
Change-Id: I15bc093ed61f0540644ce31110769ee419dd7ac2
2017-07-12 11:47:59 -07:00
Gary Qian
04950b0e3c Implement GetGlyphPositionAtCoordinate()
Change-Id: I65580c33efe6fbcf086f444f53fc59fb0dea2c56
2017-07-10 15:27:06 -07:00
Gary Qian
ba43d1e989 Take letter spacing into account when linebreaking and initial implementation of GetRectsForRange().
Change-Id: Id7fa1b5b60c988cb73ba182241b3d8b3c998e07c
2017-07-10 14:31:11 -07:00
Gary Qian
3a0422f761 Implement GetGlyphPositionAtCoordinate().
Change-Id: I78528de9d4fa1611ceb857790a3b3945c0988c9c
2017-07-07 12:09:14 -07:00
Gary Qian
7e01820ef8 Prelim ideographic baseline and MinIntrinsicWeight, Arabic test, prepare
for RTL language support implementation.

Change-Id: I99a6af74aa3607ff9b58ba98426ad3026f02b816
2017-07-06 14:46:38 -07:00
Gary Qian
4ed0e488da Add chinese tests, underline fix, cleanup, move fonts to
third_party/fonts.

Change-Id: I1b246534cd364c9e7e3fec3f6bcbe202932fee44
2017-07-06 12:25:48 -07:00
Gary Qian
b6c6f1780e Implement wavy text decoration.
Change-Id: Ie28dc4e833a24a9661e72f32f54a3e7489f81417
2017-07-05 17:20:11 -07:00
Gary Qian
42179e5403 Switch to fuchsia/third_party/benchmark
Change-Id: I40a9dadc1e910d4eb31085a71a372e2144d2d03d
2017-07-05 12:17:19 -07:00
Gary Qian
45dd415ba5 Add low memory setting on FontCollection. Only remove trailing whitespace at end of line, and do not justify last line.
Change-Id: Iee32003624862b3c7f5f2d0e999ef72719302551
2017-06-30 16:51:01 -07:00
Gary Qian
11580cea63 Move font caches to FontCollection and multiple eviction schemes. ~x200 speed improvement.
Change-Id: I1e2f940ddb36f9ac51cc95c42c2f121140ff3f6f
2017-06-30 12:05:11 -07:00
Gary Qian
4c93f0e976 Remove trailing spaces of blobs to fix decoration positioning, justify,
and centering.

Change-Id: Ide66103f95be8c090ab5ddc9888cd4defc5cde51
2017-06-29 18:03:48 -07:00
Gary Qian
d6a6221fc8 Switch to hashmap caching of font collections to be resillient to alternating fonts and slight performance improvement.
Change-Id: Ide3a311819c41e23e88e6dca06f0ce7669f6842c
2017-06-29 16:14:35 -07:00
Gary Qian
4ddb034139 Major efficiency improvements, new benches, and API change to allow changing font collections.
Change-Id: Id33cdcd161d659310d28dd36f415dc01da2e03a7
2017-06-29 15:09:38 -07:00
Gary Qian
7e02287cf9 Add additional benchmarks and initial bigO checks.
Change-Id: I3d2d9186fb187d55319c10260bf7e0d579c65a6f
2017-06-29 12:49:28 -07:00