472 Commits

Author SHA1 Message Date
Gary Qian
c67bfe8a84 Respect paragraphstyle defaults, slight font name discovery improvements, better italic tests.
Change-Id: I4f032b315a68e2279087f701ab7bd920846cd723
2017-08-09 15:35:17 -07:00
Gary Qian
1c108c04dd Use SkPath for wavy decorations for x5 improvements in performance.
Change-Id: I371f525bb91c2d415d6af4f8ff047f43678e5ac3
2017-08-09 11:13:58 -07:00
Gary Qian
653a763327 Remove rounding x values option as a workaround since jitter has been fixed. Paint benchmarks.
Change-Id: Ib74977f94768c096380a1cb9d6ec7d852fb52e4f
2017-08-08 17:58:55 -07:00
Gary Qian
9f1f39c29e Remove redundant height_ variable and add Paragraph::Paint Benchmark.
Change-Id: I82c4aee759f6ae8a869782f4fb9d979d1551eed9
2017-08-08 17:03:01 -07:00
Gary Qian
099c300214 Round height offsets to better match Blink and fix red boxes in flutter app.
Change-Id: I3cdaf5b849ea537f0e4b2406a006ba7be2f0cd61
2017-08-08 12:01:14 -07:00
Gary Qian
843d2bd71d Change type of line_ to size_t for consistency.
Change-Id: I8a15cc727dadd5f6ea9f60bd2443df068167e07c
2017-08-07 17:09:34 -07:00
Gary Qian
f1daa1e629 Hardcode no-ligature flags for performance boost, minor bugfix on trailing space.
Change-Id: Ic61b7fba6ded25790f78b5040e4eb5ba3d1376a5
2017-08-07 16:25:18 -07:00
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