Re: Font Metrics concerns

I don't think defining an API for font metrics is the right place to start.
First off, you're really probably talking about some form of *line* metrics
rather than actual font metrics. A linebox can be affected by both font
metrics and other factors such as the variation in font-size across a line
and other content (e.g. an image larger than the line height).

Even knowing the fonts used for specific glyph runs across a line does
*not* give you the information needed for proper placement.

Example:

  font-family: Arial, sans-serif;

  <p>カレー毎日食べたい</p>

In this case the line metrics will be those of Arial and not the fallback
font used to display the Japanese characters in the run.

Example:

  <p>x<sup>2</sup></p>

Here the placement of x will *not* be purely based on the font metrics used
for the 'x' character but will be affected by the linebox height when the
synthetic superscript is taken into account.

Cheers,

John

Received on Monday, 9 February 2015 12:35:53 UTC