FontDidClose event

RoboFont Forums Bugs FontDidClose event

Tagged: ,

This topic contains 3 replies, has 2 voices, and was last updated by  joanca 7 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5688

    joanca
    Participant

    Could be that the FontDidClose event is not properly catched by an observer?
    It doesn’t appears either in the list when running the RoboFontExamples/observers/eventObserver.py

    from mojo.events import addObserver, removeObserver
    
    
    class myObserver(object):
        def __init__(self):
            addObserver(self, "didOpen", "fontDidOpen")
            addObserver(self, "didClose", "fontDidClose")
            addObserver(self, "resignCurrent", "fontResignCurrent")
            
        def didOpen(self, sender):
            print "font open!"
            
        def didClose(self, sender):
            print "font close!"
            
        def resignCurrent(self, sender):
            print "not current"
            
    myObserver()
    
    #5691

    joanca
    Participant

    Well, the thing is that I wanted to update in a vanilla popUpButton AllFonts when a font did close. If I do it with fontWillClose the font is still there.
    I just found it in the docs and seemed useful for what I wanted. I’ll find another approach then. Thanks

    #5692

    frederik
    Keymaster

    I see

    will add a fontDidClosenotification, but it will be a generic one: it will not send any font data cause the font is already released from memory by then.

    #5693

    joanca
    Participant

    Yes, that will work. Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.