The revisions rP24075/rP2407 introduced a bug in the overlay box (fps, (game)time, ceasefire) which resulted in the lines being wrapped. D3391/rP24755 made the overlay look good again. The patch reduces duplication and makes the code not depend on the initial size being big enough.
It does not address the performance concern of the mentioned commit.
We generalize the resizeGUIObjectToCaption from D2623/rP26349 to also do the vertical component.
Make the GetTextSize font function handle newlines.
Add the BufferZone also for aligning to the right.
This patch superseeds D3022