UNSOLVED 'sorting' script. Not sure about pen

  • Hey guys, I created a small script that makes sorting contours easy (at least for me)
    Everyone, feel free to use that.

    I'm not sure about the usage of the Pens though:

    1. is drawing in rearrangeOrder function done accordingly to the proper way of using pen-protocol? I was improvising a bit and I'm not sure about it.
    2. I'm working from time to time with point labels. The pen object created by me is deleting data like that: Is there any good way to make sure that when redrawing the glyph none of the data like that will be erased?

    Best, R