Rough port of the SDL_Pango side.