[skottie] Visual text valign

Historically, Skottie started with vertical alignment based on the
typographic bounding box.  This was meant to account for empty
leading/trailing lines.

At some point [1], the strategy was changed to also take the visual
bounding box into account (union of typographic and visual bounds).

It turns out this is still suboptimal: aligning based on font metrics
yields poor results in practice, and pretty much everyone expects
visual-only alignment.

This CL introduces three new visual-only VAlign modes:

  - kVisualTop (vj: 3)
  - kVisualCenter (vj: 4)
  - kVisualBottom (vj: 5)

Existing assets using the legacy kHybrid modes (vj: 0..2) should be
unaffected.

[1] https://skia-review.googlesource.com/c/skia/+/224188

Bug: b/265243822
Change-Id: I5cc3947894e1406ccce8d8cfd24f33cab33bfb73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/639416
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
5 files changed