[whatwg] Font metrics

Mathieu 'p01' Henri p01 at opera.com
Tue Apr 6 00:21:44 PDT 2010


On Sat, 03 Apr 2010 17:23:39 +0300, Greg Brown <gkbrown at mac.com> wrote:

> OK, that makes sense. Thanks for the info.

However, a extra readonly attribute float "height" to the "TextMetrics"  
interface should be fairly trivial to implement for browser vendors and  
would greatly help web developers layout text in Canvas.




> On Apr 2, 2010, at 5:39 PM, Ian Hickson wrote:
>
>> On Fri, 2 Apr 2010, Greg Brown wrote:
>>>
>>> In reviewing the current draft API for the <canvas> element
>>> (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html),
>>> I noticed that there is no support for obtaining font metrics such as
>>> ascent, descent, leading, and bounding box. It seems like the most
>>> recent discussion regarding font metrics took place a couple of years
>>> ago:
>>>
>>> http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2008-May/014706.html
>>>
>>> But even that thread refers to discussions from 2006.
>>>
>>> I would personally like to see support for these values added to the
>>> API. Is this something that could be considered for the final spec?  
>>> What
>>> are the major obstacles to providing such support? I would think that
>>> this information could be easily obtained using the underlying graphics
>>> API, but maybe I am missing something.
>>
>> It's something we'll probably add in due course, but for now we're  
>> waiting
>> for the existing canvas API stuff to be implemented properly. We can't  
>> add
>> too much stuff at once, because if we do the browser vendors get so far
>> behind that they end up either rushing to catch up (leading to more  
>> bugs),
>> or skipping parts in order to get the rest done right (leading to parts  
>> of
>> the spec being ignored).
>>
>> --
>> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
>> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
>> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
>


-- 
Mathieu 'p01' Henri \ Opera Software
JavaScript Developer \  Core ExtApps


More information about the whatwg mailing list