Fix textBaseline alignment to match the spec for top/bottom/middle.
Our current implementation of canvas textBaseline alignment for top middle and bottom doesn't do what the spec says it should, i.e. align with the EM square. https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-textbaseline This has been a bug on FF side for quite some years: https://bugzilla.mozilla.org/show_bug.cgi?id=737852 This change fixes this misalignment by using the EM square ascent and descent from SimpleFontData instead of the font's max ascent/descent. Also fixing the EM related metrics in canvas TextMetrics. Bug:607053,277215 Change-Id: Id6374e6fcd4e46fa989a7e23a80dc1f5bf961b94 Reviewed-on: https://chromium-review.googlesource.com/1194494 Commit-Queue: David Quiroz Marin <davidqu@chromium.org> Reviewed-by:Fernando Serboncini <fserb@chromium.org> Cr-Commit-Position: refs/heads/master@{#587855}
Showing
File moved
4.68 KB
4.68 KB