Re: [w3ctag/design-reviews] Tag Review Request: Canvas TextMetrics (#302)

Fundamentally these seem like reasonable things for `measureText` to return.

While I'm not sure feedback here is the best way to get issues back to the editors, a few comments/questions:
* how do `actualBoundingBoxLeft` and `actualBoundingBoxRight` deal with vertical text?  (Even if the answer is "this API doesn't currently support vertical text" (which seems to be the case since [CanvasTextDrawingStyles](https://html.spec.whatwg.org/multipage/canvas.html#canvastextdrawingstyles) has `direction` but not `writingMode`)... the names seem bad for when it's likely to be extended to do so in the future.)
* how do the definitions of "positive numbers" for all the `*Ascent` and `*Descent` values deal with vertical text?
* there are multiple references to a "line box", yet I don't see anything that says what this line box is.  Do these mean "inline box" instead?
* it seems like `hangingBaseline`, `alphabeticBaseline`, and `ideographicBaseline` should define the behavior when multiple fonts are present.  Is it the [first available font](https://drafts.csswg.org/css-fonts-4/#first-available-font) what should be used?
* the API methods don't say anything about what rounding is performed.  Is the expectation that the results be round numbers of CSS pixels, round numbers of device pixels, or unrounded?
* all of the "positive numbers indicating that the given baseline is (below/above) the X" seem confusing to me, and seem like they'd be clearer if they were swapped to "positive numbers indicating that X is (above/below) the given baseline" (note that the order is swapped and the above/below are swapped so that the statement is still true).  That's probably just preference, though.  (But it does make them more consistent with the preceding 4 definitions.)
* the definitions of `emHeightAscent` and `emHeightDescent` should probably have wording that repeats the "of all the fonts used to render the text" used in defining `fontBoundingBoxAscent` etc., assuming that is what is intended (which I think it is given the "highest top" and "lowest bottom" wording); otherwise it's not clear what it's the "highest" or "lowest" of.  (For example, it's important that it's all fonts used to render the actual text rather than all fonts that could have been used given any possible text.)
* the "half the font size if the given baseline is the middle of that em square" comment only seems true if there's only a single font or if the em squares of all fonts used line up (at least assuming my previous assumption was correct)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/302#issuecomment-422999075

Received on Thursday, 20 September 2018 00:20:05 UTC