python-imaging/Pillow — pull request #383 by hugovk (2013-10-17 16:04:49+00:00)
Title: Fix for issue #382: TypeError with TransposedFont's getsize()

Fix and test cases.

---

When getting the size of text with a TransposedFont it was failing:

```
File "/usr/local/lib/python2.7/site-packages/PIL/ImageDraw.py", line 281, in textsize
return font.getsize(text)
File "/usr/local/lib/python2.7/site-packages/PIL/ImageFont.py", line 189, in getsize
w, h = self.font.getsize(text)[0]
TypeError: 'int' object is not iterable
```

This is because self.font.getsize(text) returns a (w, h) tuple. To fix, remove the [0].

Test cases have been created in test_imagefont.py:
```
test_rotated_transposed_font()
test_unrotated_transposed_font()
```

Both fail before the fix, both pass with the fix. Furthermore, the code I'm using this from ( https://github.com/mattdeboard/word_cloud ) now works as expected and creates a word cloud similar to the ones that PIL created.