-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canvas textBaseline needs better tests #6731
Comments
See #5826. |
Any updates on this? We still get users complaining about inconsistencies in text positioning between Chrome and Safari, and it doesn't seem there's anything we can do about it until this gets sorted. |
cc @whatwg/canvas |
This comment was marked as duplicate.
This comment was marked as duplicate.
No, I didn't manage to get review on #5826. I'll agenda+ it to see if I can get some attention on it that way. Meanwhile, you could read up on the CSS definition of this concept and determine which browser is in the wrong here. Coupled with some WPT tests, the affected browser might be willing to change and that could suffice as an interim solution. |
This comment was marked as duplicate.
This comment was marked as duplicate.
I think this depends on resolving #5830, which in turn depends on resolving a CSS WG issue (w3c/csswg-drafts#5380) |
This comment was marked as duplicate.
This comment was marked as duplicate.
See w3c/csswg-drafts#5312. And also #5429 for where all of this started. This should help #6731 quite a bit too.
Chrome and Safari draw text with the "top" baseline at different positions in canvas2d. See the following issues:
https://bugs.webkit.org/show_bug.cgi?id=226334
https://bugs.chromium.org/p/chromium/issues/detail?id=1213949
Image demonstrating comparison: https://downloads.scirra.com/labs/bugs/text-top-baseline/comparison.png
This causes web compat issues. For example our web game engine cannot display text consistently across platforms because each browser positions text slightly differently. This makes it difficult to do things like perfectly align text relative to other canvas drawings, such as in a border or button graphic.
Apparently this was previously discussed to some extent in #2470 but is not adequately resolved as it is still actively causing web compat issues and the spec does not appear to cover a definition of "the em square".
The spec should clearly define this so browser makers can identify if their browser complies with the spec in this regard, and if necessary make changes to their implementation to ensure compatibility. As it is I don't think it's clear which browser is doing it right (if any).
The text was updated successfully, but these errors were encountered: