Added functionality for painting text.