Summary of useful changes:
- modified the parameters given to append_unicode(), [and append_offset() but it seems the offsets are actually handled in state.cc] in text.cc
- kept the update of dx and dy as it used to be in text.cc
- left the comments of debug attempts