Restore size clamping in rendering

https://www.w3.org/Bugs/Public/show_bug.cgi?id=25660

This was removed in commit 3d05e2e05c72b01404cf290bf07c7f0f367827a7.
Text direction (LRT/RTL) now has no effect on position, so the restored
text is somewhat simpler than the original.