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.


[2] http://www.w3.org/TR/SVG11/text.html#TextAlignmentProperties
[3] http://wiki.apache.org/xmlgraphics-fop/LineLayout/AlignmentHandling

Reply via email to