Fix the calculation of default vertical metrics

Fixes bug 849627 and 849628.
The current code was obviously wrong per the spec 9.7.4.3.
Merge pull request #2932 from vyv03354/bug849627

Fix the calculation of default vertical metrics