W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2010

[whatwg] Adding descent to TextMetrics

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 10 Aug 2010 23:09:01 +0000 (UTC)
Message-ID: <Pine.LNX.4.64.1008102307540.11992@ps20323.dreamhostps.com>
On Thu, 8 Jul 2010, Charles Pritchard wrote:
> 
> We've been doing some work with html line boxes; mainly, mixed font 
> styles in a text area, using the HTML Canvas element. While Canvas 
> fillText does have the textBaseline attribute, in order to set the 
> current alignment, it does not provide enough metrics through the 
> measureText function for us to exploit the textBaseline attribute across 
> fonts (sizes and styles).
> 
> Adding descent, to the measureText object would allow us to do more. 
> Currently, TextMetrics only returns "width". I'm proposing adding 
> "descent" to that list.

I recommend not using <canvas> for text editing.

Adding more features to TextMetrics is on the cards for a future version 
of the canvas API, but at the moment I'm waiting until more of the spec is 
reliably implemented before adding more features, so that we don't get too 
far ahead of the spec.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 10 August 2010 16:09:01 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:26 UTC