Takes accent/descent in account in the text layer

Fixes #3725