improvements to cairo text handling