code: def width_at_offset(self, n):
          
          #TODO make more efficient?
          width = wcswidth(self.s[:n])
          assert width != -1
          return width
docs: Returns the horizontal position of character n of the string