Examine setting an object's parent via obj.foo = parent property.
The glyph object uses this internally so it is available in some cases but not all. It needs to be consistent.
This already works. I don't know why I thought that it didn't.
This related to contour and glyphs. If you set a contour’s parent to a glyph, that contour isn’t added to the glyph. See contour tests where I had to append the contour to a glyph instead of setting the parent.
On May 18, 2018, at 7:02 PM, Tal Leming [email protected] wrote:
Closed #285.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
I just reviewed the code again and I don't see a way to make fooInstance.bar = barInstance add fooInstance to barInstance unless fooInstance is an orphan object. If it isn't, things get messy. Imagine something like this:
glyph = font1["A"]
glyph.font = font2
Would that remove the glyph from font1? FontShell could handle something like that, but other environments may not be able to.
I think we should think of childInstance.parent = parentInstance as purely a way for childInstance to set any necessary internal references to parentInstance.
Does that address this issue? I should have added more notes when I opened it.
I think so. Should we make the setting private, and only the get public? That seems to be safe/rational.