Commit Graph

1 Commits

Author SHA1 Message Date
Florin Malita
afd2c10c98 [skottie] Use hybrid bounds for custom Shaper VAlign modes
We used to rely solely on visual bounds for vertical alignment.  That
had the downside of leading/trailing empty lines being ignored.

Then https://skia-review.googlesource.com/c/skia/+/220916 switched to
using typographical bounds.  This approach produces results in line
with AE, but allows some glyphs to overflow the alignment boundary.

This CL introduces a hybrid approach:

1) for standard AE text alignment, continue to use typographical bounds

2) for Skottie VAlign extensions (sk_vj), use the union of typographical
   and visual bounds - this should mitigate both issues mentioned above

Change-Id: Ifd3ccae3d721728ce67942206160ebe92056d3a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224188
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Avinash Parchuri <aparchur@google.com>
2019-06-28 11:35:09 +00:00