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'sdrawView
, I can see the report in the output window (usually aKeyError
or aRoboFontError
).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!
-
Ah, makes total sense!
(I guess I should have realized the difference since I had to use DrawView's
setPDFDocument(pdf)
function... haha :smirk: )Thanks for the response. The Canvas update sounds great!
-
DrawBot only sets pdf data in the
DrawView
when the script is done. With aCanvas
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 (likedraw
,mouseDown
, ...) to a delegate object.
-
Right — I understand why I got that error, but I'm curious why
Canvas
crashes butDrawView
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:
Sidenote: On top of using
GlyphSequenceEditText
(orsplitText
), 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!
-
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 theEditText
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
-
(Of course, if I just use
GlyphSequenceEditText
, it's fine for the most part, unless I type in/
+ missing glyph.)
-
Here's what the log shows.
To test this, I used the basic
vanilla.EditText
instead of SpaceCenter'sGlyphSequenceEditText
. When I get this error with DB'sDrawView
, it's logged in the Output window, but won't crash RF.I'm currently on Sierra, 10.12.6.
-
is there anything in the
robofont.log
(you will find this on<userName>/library/Application Support/RoboFont
what is your OS?
thanks