Takes ascent/descent in account in the text layer
Merge pull request #4089 from yurydelendik/issue3725

Takes ascent/descent in account in the text layer
Fixes FF bug 960409 and removes do-while construct as per review request