Closed alex-phil closed 2 years ago
@alex-phil Yes you are totally right! Fixed! Thank you Alex!
Vassil, I just wanted to make sure whether this was intended. With the current setup of the function, setMark() will set layer-specific flags only. Since you removed the if-else structure from the function code, setting glyph-specific flags now seems to require iterating over all layers of a glyph and applying setMark() to each of them. Which might raise issues with backwards compatibility of existing scripts that use setMark().
def setMark(self, mark_color, layer=None):
if layer is None:
self.fl.mark = self.mark = mark_color
else:
self.layer(layer).mark = mark_color
Good question @alex-phil! Will investigate... i have some strange feeling that the global flGlyph.mark was actually not working ...
I just checked, @kateliev. We can use
from typerig.proxy.fl.objects.glyph import *
pGlyph().mark = 100
to set the glyph-specific flag for the current glyph to 100. So the global flGlyph.mark seems to be working.
@alex-phil fixed! Thank you!
Vassil, please take a look at this line:
https://github.com/kateliev/TypeRig/blob/74a486c80116105116711004f64018ff6d3b3116/Lib/typerig/proxy/fl/objects/glyph.py#L171
I think it must be replaced by
self.layer(layer).mark = mark_color
to make the code work. Try to set a layer-specific flag with the method, and you will get an error. Thank you for looking into this.