Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Solved
    • Unsolved
    1. Home
    2. Tags
    3. observers
    Log in to post

    • erik

      SOLVED Observer for selection in Font window?
      Feature Requests • observers selection feature request fontwindow • • erik  

      2
      0
      Votes
      2
      Posts
      1105
      Views

      frederik

      that would be currentGlyphChanged...
    • Guest

      UNSOLVED Observing isCompatible bug when using bezier tool
      Problems & Bugs • scripting observers • • Guest  

      1
      0
      Votes
      1
      Posts
      604
      Views

      Guest

      Hello again! My weekend robofont training (self imposed) continues, and I may have discovered a bug. I am attempting a live update on the compatibility of two glyphs from different fonts. The idea at its most basic could manifest as a red mark drawn to the glyph window canvas whenever the glyph becomes incompatible whilst you are drawing/editing the glyph. I am using isCompatible() and a glyph.changed observer It reports when I make a change to the glyph, calling a function that for now simply prints the result of isCompatible. It works fine if I remove a contour, and it works fine if I add a point to an existing contour using knife, but it seems to crash if I use the bezier tool to start drawing a new contour. I have a gist here, please try to replicate the error. https://gist.github.com/MBurvill/fb6772f9e8bc49e583f16e6dc650b7d8#file-isCompatibleObserverBugTest-py FYI I found the useage of glyph.changed in one of Frederiks examples (stencil preview), but usage of this observer appears to be undocumented, I would expect to be able to find it at http://doc.robofont.com/api/custom-observers/ Thanks!
    • jens

      SOLVED Contextual Menu in font view?
      General Questions • user interface observers font overview • • jens  

      3
      0
      Votes
      3
      Posts
      686
      Views

      jens

      Nice, thank you!
    • bahman

      MouseDown Observer detailed info
      General Questions • user interaction observers anchors • • bahman  

      2
      0
      Votes
      2
      Posts
      524
      Views

      frederik

      there is Glyph.selection.Changed notification small example also don't forget to remove the observer when your are done... class SelectionObsever(object): def __init__(self): self.g = CurrentGlyph() self.g.addObserver(self, "selectionChanged", "Glyph.selectionChanged") def selectionChanged(self, notification): glyph = notification.object for anchor in glyph.anchors: print anchor.selected SelectionObsever()
    • franz

      Catching key events in extension window
      General Questions • extensions observers • • franz  

      3
      0
      Votes
      3
      Posts
      623
      Views

      franz

      Hi Frederik, Ouch, I will see if I can get this to work, may thanks!
    • jo

      Help please with keyDown Observer
      General Questions • user interaction observers • • jo  

      3
      0
      Votes
      3
      Posts
      616
      Views

      jo

      hey frederik, I was sooo close … Thanks a lot for your help, working perfectly now. jo
    • joanca

      FontDidClose event
      Problems & Bugs • scripting observers • • joanca  

      4
      0
      Votes
      4
      Posts
      680
      Views

      joanca

      Yes, that will work. Thanks!
    • thom

      Draw in output window
      Problems & Bugs • observers • • thom  

      5
      0
      Votes
      5
      Posts
      711
      Views

      frederik

      Yes that is possible only you have to tell a glyphview to redraw it self Use UpdateCurrentGlyphView() and off course subscribe to the draw notification See http://doc.robofont.com/api/mojo/mojo-ui/ (Will fix the oldstyle notification)
    • jack_jennings

      SOLVED Font Collection Custom Tool
      General Questions • scripting user interface observers vanilla mojo • • jack_jennings  

      8
      0
      Votes
      8
      Posts
      1176
      Views

      frederik

      He I've written a proper vanilla patch which is already in the vanilla repo. This will be in the next update of RoboFont. It adds addToolBarItem and removeToolbarItem to a vanilla window object, able to manage toolbar items properly. see https://github.com/typesupply/vanilla/blob/master/Lib/vanilla/vanillaWindows.py#L631
    • jmickel

      Default Font Info settings
      Feature Requests • observers font info • • jmickel  

      2
      0
      Votes
      2
      Posts
      487
      Views

      frederik

      That is easy: subscribe to newFontDidOpen and do something with the new font. from mojo.events import addObserver class SetInfo(object): def __init__(self): addObserver(self, "myCallback", "newFontDidOpen") def myCallback(self, info): font = info["font"] print font font.info.copyright = "This is my font" SetInfo() and maybe set this script as start up script in the preferences so each time you open RoboFont the observer will be installed. good luck
    • tom

      GlyphPreview performance
      General Questions • extensions observers interpolation • • tom  

      4
      0
      Votes
      4
      Posts
      750
      Views

      tom

      This seems to fix my problem, thanks so much! One more thing, what would be the name of the observer for if a glyph is modified?—so that I can update the preview as you make changes. Is there a list somewhere of all the built in observers? Cheers!
    • marksimonson

      Observers and events
      Feature Requests • space center observers glyph names • • marksimonson  

      9
      0
      Votes
      9
      Posts
      1147
      Views

      frederik

      great! thanks
    • mbutterick

      Observer callback format
      General Questions • scripting observers • • mbutterick  

      3
      0
      Votes
      3
      Posts
      692
      Views

      mbutterick

      Why is info a dict instead of an instance of a reall class defined in mojo.events? I ask about source code because __doc__ seems to be empty for all the mojo.* modules and classes, and the API documentation is missing a lot. I'm looking for a way to supplement my understanding of the API without asking you a hundred questions.