default .ufo and .py



  • Is there a way to change the default ufo that opens when opening a new font, or do I need to auto generate what I need on newFontDidOpen?
    Can this be done for new scripts also? I wish to put font = CurrentFont() etc. in there by default.


  • admin

    hi Timo,

    the character set of new fonts can be chosen in the preferences:

    Screen Shot 2019-03-12 at 11.25.30.png

    other than this, you’ll really need to use a newFontDidOpen observer:

    from mojo.events import addObserver
    
    class MyCustomNewFont:
    
        def __init__(self):
            addObserver(self, "customizeFont", "newFontDidOpen")
    
        def customizeFont(self, info):
            f = info['font']
            f.info.familyName = 'Untitled'
    
    MyCustomNewFont()
    

    AFAIK there’s no notification for new scripts… maybe something to consider


  • admin

    There is the wonderfull RoboREPL extension from Tal, where you have a terminal style direct interactions


  • admin

    this is very nice indeed :) use settings.editStartupCode() to define some code to be executed when the interpreter is started:

    Screen Shot 2019-03-13 at 14.57.11.png



  • Yes, it's very handy. It would be handy also in the scripting window. :)
    Thanks!