I'm writing a script for FL and RF and I need to translate a glyph to SVG. I'm trying to find the best way to do this with a glyph with components and I have a problem with this sollutions:
if len(g.components): # if glyph has components
g = g.copy() # create a copy of it
g.decompose() # decompose it without affecting the original glyph
# do stuff with the decomposed glyph
This method works great in FL, in RF however, it doesn't create a copy, but decomposes the glyph directly in the font. I tried to implement prepareUndo and performUndo methods, but they didn't seem to work. Do you have any tips on how I could make this work in RF?