GoodBoyDigital/pixi.js — pull request #1062 by EricLesch (2014-10-17 13:58:58+00:00)
Title: Fixing issue #1021 Inconsistent Text Positioning across different browse...

This resolves issue #1021. It uses 'alphabetic' (default) for the baseline and calculates the ascent for the font to ensure that text placement it is consistent across browsers. Browsers seem to agree where 'alphabetic' is but don't agree on where 'top' is.

The method for calculating font ascent is grabbed from here https://github.com/Pomax/fontmetrics.js. I don't know what is the appropriate way to credit in this situation. We are including a fraction of the original code in this solution since we only need one value.

An alternative solution for calculating the ascent is simply multiplying the font's height by 0.75. This provides a less accurate (but usually fairly close) solution with a lot less code. This seems to be the method that Fabric.js employs. I felt it was not accurate enough for my purposes.

Let me know if you have any other questions.

Thanks,
Eric