Closed Bug 438702 Opened 12 years ago Closed 9 years ago

Canvas text baselines not fully implemented


(Core :: Canvas: 2D, enhancement)

Not set





(Reporter: ebutler, Assigned: jag+mozilla)


(Blocks 1 open bug)


(Keywords: html5)


(2 files)

The textBaseline attribute of Canvas is not fully implemented. The "ideographic" and "hanging" baselines are currently silently treated as the "alphabetic" baseline due to lack of font metric support.
Not sure Sanskrit and Chinese are the right glyphs to trigger hanging and ideographic, but replacing the text is easy enough.

Webkit doesn't seem to properly handle hanging and ideographic either, though they've picked "top" as the fallback for "hanging", and "bottom" as the fallback for "ideographic".

What is "hanging" supposed to do for non-hanging glyphs? Depending on the answer to that we might also want to make "top" the fallback for "hanging".
Duplicate of this bug: 548918
this is how it's /supposed/ to work 

isn't that just height - x-height + top ?
and ideographic is the (bottom - (heightofasiancharacter-bottom))?
Jamie Pate: I interpret the colored lines matching the colored glyphs to mean that certain concepts only apply to certain groups of glyphs. Is that what you mean?
In SVG we apparently do let "hanging" fall through to "top" (called text_before_edge there), so for consistency with SVG and with Webkit I think we should too.
Attachment #502346 - Flags: review? → review?(roc)
Comment on attachment 502346 [details] [diff] [review]
Make "hanging" like "top" for parity with SVG and webkit.

Just noticed I left an extra |break;| in. That should be removed before check-in.
As an heuristic for "hanging" the point halfway between xHeight and emAscent seems to work reasonably well.
Attachment #502346 - Flags: approval2.0?
Comment on attachment 502346 [details] [diff] [review]
Make "hanging" like "top" for parity with SVG and webkit.

Sorry, it's just too late for this bug to land (especially with no tests). Let's get it in post-2.0.0.
Attachment #502346 - Flags: approval2.0? → approval2.0-
Assignee: nobody → jag-mozilla
Whiteboard: fixed-in-cedar
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: fixed-in-cedar
Target Milestone: --- → mozilla2.2
Blocks: 1325836
You need to log in before you can comment on or make changes to this bug.