You might be able to adapt the code in contrib/intagg to handle text.I'm not sure what would be involved in doing so.
-- greg