Text._get_layout returns a list w, h, d

Here are a few fixes I made.

I think it is better to return the list of w, h, d, instead of just returning the last d.