To return a proper baseline, font size and scales need to be calculated. The former implementation ignored scaling and returned inaccurate results. The extra code is taken directly from the Flash AS3 implementation and resolved the alignment issue.