Skip to content
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

[css-inline-3] Canvas 2D's textBaseline = "middle" neccessitates an em-middle baseline? #5431

Open
annevk opened this issue Aug 14, 2020 · 6 comments
Assignees
Labels
css-inline-3 Current Work HTML Requires coordination with HTML people

Comments

@annevk
Copy link
Member

annevk commented Aug 14, 2020

It's described as "The middle of the em square".

This is a follow-up to #5312 that only looked at the measureText() API which doesn't expose this.

cc @yiyix @kojiishi @macnmm @litherum

@annevk annevk added css-inline-3 Current Work HTML Requires coordination with HTML people labels Aug 14, 2020
@annevk
Copy link
Member Author

annevk commented Aug 14, 2020

Maybe an alternative is that I describe it as the middle of the em-over and em-under baselines, but we might as well have a term for it?

annevk added a commit to whatwg/html that referenced this issue Aug 14, 2020
See w3c/csswg-drafts#5312. And also #5429 for where all of this started.

Ideally though w3c/csswg-drafts#5431 would be fixed too and we'd figure out how to update images/baselines.png (I've asked Ian if there's an original somewhere).
@fantasai
Copy link
Collaborator

@annevk I think you should be able to use the central baseline definition for this, no? Note that vertical-align: middle is defined as using the "ex-middle" baseline, so there will be some inconsistency in terminology between Canvas and CSS.

@annevk
Copy link
Member Author

annevk commented Aug 20, 2020

What is ex-middle? I don't see it in https://drafts.csswg.org/css-inline/#baseline-types.

And are we sure the middle of em-over and em-under is equal to the middle of ideographic-under and ideographic-over? If so, that's probably worth noting in the specification, but it seems unlikely that would be the case?

@fantasai
Copy link
Collaborator

@annevk sorry, “x-middle”. You're right, it could differ in the case where the ideographic baselines are not defined by the font and the ascent + descent != 1em, we don't currently define how to find the central baseline in that case. In that case I'd say you should just define it as halfway between em-over and em-under, assuming that's the relationship you want to encode there.

@annevk
Copy link
Member Author

annevk commented Aug 24, 2020

Yeah, though it seems a bit weird that we would sometimes give that an explicit baseline definition (e.g., as for central) and sometimes not.

@fantasai
Copy link
Collaborator

@annevk Yeah, but it's a simple relationship between two existing terms (whereas defining what each of these terms are is not). I'll note CSS doesn't use these at all so defining any of them here is a bit weird to begin with :)

annevk added a commit to whatwg/html that referenced this issue Jun 2, 2021
See w3c/csswg-drafts#5312. And also #5429 for where all of this started.

Ideally though w3c/csswg-drafts#5431 would be fixed too and we'd figure out how to update images/baselines.png (I've asked Ian if there's an original somewhere).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-inline-3 Current Work HTML Requires coordination with HTML people
Projects
None yet
Development

No branches or pull requests

2 participants