[whatwg] Canvas Computing text metrics

Hi,

The spec says that the object TextMetrics[1] must return font and actual text metrics. All things require information from the font or the font system. In many cases either font or font system just do not provide these information.

Instead of assuming that all information are accessible by the browser, it might be useful to define some heuristics that can be used.

In WebKit and Blink we support the CSS dominant-baseline property in SVG that requires similar metrics as well[2]. Even SVG does not specify the heuristics yet and instead leaves that up to the browser.

WebKit and Blink use the heuristics described in the documentation from Apache FOP[1]. Should these be used as fallback heuristics?

Note: Many browsers might use heuristics by default since they can’t get all necessary font metrics at all.

Greetings,
Dirk

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#textmetrics
[2] http://www.w3.org/TR/SVG11/text.html#TextAlignmentProperties
[3] http://wiki.apache.org/xmlgraphics-fop/LineLayout/AlignmentHandling

Received on Sunday, 6 April 2014 06:24:06 UTC