fix bugs in cairo text rendering