Follow the Current Glyph ↩
The following example shows how to follow the CurrentGlyph()
across every UI component in the RoboFont application. Consider that the Subscriber
class needs to be registered at the application level with registerRoboFontSubscriber
, not with registerCurrentGlyphSubscriber
.
from mojo.subscriber import Subscriber, registerRoboFontSubscriber
class Follower(Subscriber):
def roboFontDidSwitchCurrentGlyph(self, info):
print(info["glyph"])
if __name__ == '__main__':
registerRoboFontSubscriber(Follower)