Cleaned up measure_text() and draw_text() API.