Remove unnecessary function from TextPainter