mojo.canvas crashing?



  • Hi! I'm finding that mojo.canvas somehow crashes my RoboFont whenever there's an error. I don't see anything in the output window, and RF just quits. If I switch to DB's drawView, I can see the report in the output window (usually a KeyError or a RoboFontError).

    Is this a known issue, or maybe I'm implementing something incorrectly? I don't have an example right now, but can write one if needed.

    Thanks!


  • admin

    is there anything in the robofont.log (you will find this on <userName>/library/Application Support/RoboFont

    what is your OS?

    thanks



  • Here's what the log shows.
    0_1515427969873_Screen Shot 2018-01-08 at 11.08.30 AM.png

    To test this, I used the basic vanilla.EditText instead of SpaceCenter's GlyphSequenceEditText. When I get this error with DB's DrawView, it's logged in the Output window, but won't crash RF.

    I'm currently on Sierra, 10.12.6.



  • (Of course, if I just use GlyphSequenceEditText, it's fine for the most part, unless I type in / + missing glyph.)


  • admin

    I think I see what you are trying to do 🙂

    ? will not be a valid glyph name... you need to convert the input string from the EditText object to a list of glyph names.

    from defconAppKit.tools.textSplitter import splitText
    
    font = CurrentFont()
    print splitText(u“héllo world?”, font.getCharacterMapping(), fallback=“.notdef”)
    

    The crash happens because it goes wrong while drawing on screen and that is the worst place to raise a traceback...

    Good luck



  • Right — I understand why I got that error, but I'm curious why Canvas crashes but DrawView doesn't? It's also not specific to that error (sorry, I probably should've mentioned this earlier).

    Here's another example from the log:
    0_1515513306396_Screen Shot 2018-01-09 at 10.52.16 AM.png

    Sidenote: On top of using GlyphSequenceEditText (or splitText), I've also had to use a try/except block because while the .notdef fallback is returned when I type in /?, it doesn't do it for something like /3.

    Thanks Frederik!


  • admin

    DrawBot only sets pdf data in the DrawView when the script is done. With a Canvas view you draw directly while its refreshing the view. The is lots faster but also fragile.

    Already implemented in the next RoboFont updates is that a Canvas object catches errors while sending notifications (like draw, mouseDown, ...) to a delegate object.



  • Ah, makes total sense!

    (I guess I should have realized the difference since I had to use DrawView's setPDFDocument(pdf) function... haha 😏 )

    Thanks for the response. The Canvas update sounds great!


Log in to reply
 

Looks like your connection to RoboFont ● Forum was lost, please wait while we try to reconnect.