make font metrics visible to user

Hey everyone,
I am one of the maintainers of the svg.js library and one thing we stumpled
over was svg text which is really hard to tame. The text is positioned
relative to the baseline which makes sense in one case but is bad in
others. We tried to position text based on the upper left edge and
currently we use browsers bounding box implementation to achieve that.
However - this differs around browsers and I was looking for a more stable
way to do that.
One possibility which came into my mind was to add a method to get the
metrics of the font which is used. Most importingly the values of
unitsPerEm and the baseline position. That alone would allow us to move the
text in a consistent manner.
Is there any effort I dont know of to put something like this into the
specs?

Thanks for reading! Cheers,
Fuzzy

Received on Tuesday, 25 April 2017 00:28:34 UTC