frederik

Forum Replies Created

Viewing 15 posts - 406 through 420 (of 531 total)
  • Author
    Posts
  • in reply to: Up and down #3873

    frederik
    Keymaster

    a feature when the earth flips his magnetic field

    in reply to: Up and down #3871

    frederik
    Keymaster

    Cause some times, in exceptional situations up is down.

    will be solved in next version :)

    in reply to: RoboFontError: Glyph not in font #3839

    frederik
    Keymaster

    He

    This will also not work in robofab :)

    You can check if a glyphName is in the font:

    f = CurrentFont()
    
    gname = "test"
    
    if gname in f:
        print gname
    else: #f[gname] not in f
        print "%s not in %s" %(gname, f)
    

    good luck

    in reply to: Scripting Window – Remember size and position #3835

    frederik
    Keymaster

    added, will be in the next update :)

    thanks for reporting

    in reply to: Disable single option of vanilla RadioGroup? #3834

    frederik
    Keymaster

    If I understood it correctly your want to disable (grayed out) an option in a RadioGroup.

    from vanilla import *
    
    class Test:
        
        def __init__(self):
            
            self.w = Window((400, 400))
            
            self.w.allOptions = CheckBox((10, 10, -10, 22), "All Options", callback=self.allOptionsCallback)
            self.w.radioButtons = RadioGroup((10, 40, -10, 80), ["option 1", "option 2", "option 3"])
            
            self.w.radioButtons.getNSMatrix().cellAtRow_column_(2, 0).setEnabled_(False)
            
            self.w.open()
        
        def allOptionsCallback(self, sender):
            self.w.radioButtons.getNSMatrix().cellAtRow_column_(2, 0).setEnabled_(sender.get())
            
    Test()
    

    hope this helps

    in reply to: Undo for multiple glyphs/list? #3828

    frederik
    Keymaster

    cool

    you could change the vanilla.Window to a vanilla.FloatingWindow

    A floating window will not became the first responder to actions send by fe. the menu bar.

    succes!

    in reply to: Undo for multiple glyphs/list? #3824

    frederik
    Keymaster

    He

    A list object does not have a prepareUndo preformUndo methods.

    The best way is to tell each glyph while looping over all glyphNames to prepareUndo preformUndo

    font = CurrentFont()
    glyphNames = font.selection
    if not glyphNames:
        glyphNames = font.keys()
    
    for glyphName in glyphNames:
        glyph = font[glyphName]
        glyph.prepareUndo("myAction")
        # action start
        glyph.move((100, 100))
        # action end
        glyph.performUndo()
    

    You can have multiple undo’s when selecting multiple glyphs in the Font Overview and hit ⌘-Z
    Bundling undo states over several glyphs into one undo state isn’t possible cause each glyph has his own undo manager.

    hope this helps

    in reply to: Modifying curves #3822

    frederik
    Keymaster

    mm, you can make a subclass of the EditTool and overwrite the modifyDraggingPoint(point, delta) method to ignore 45° and only look for 0° and 90° angles.

    But not pref settings (yet, will think about it)

    in reply to: Resize space window #3817

    frederik
    Keymaster

    ah this seems only to be an issue on 10.6…..

    in reply to: Observers and events #3815

    frederik
    Keymaster

    great!
    thanks

    in reply to: Disappearing Images #3813

    frederik
    Keymaster

    Hi

    I cannot reproduce this issue.
    RoboFont version?
    OS version?
    Is there a transformation on the image?
    Any image adjustment? (contrast, brightness,…)

    in reply to: Observers and events #3806

    frederik
    Keymaster

    mmmm, oke

    Im kind of guessing what you want to achieve but maybe this can help to.

    A SpaceCenter object also has a setRaw and getRaw methods, expecting a string, text as input or return.

    from robofab.interface.all.dialogs import AskString
    from mojo.UI import CurrentSpaceCenter
    
    sp = CurrentSpaceCenter()
    
    text = AskString("input")
    sp.setRaw(text)
    

    (Ive just updated http://doc.robofont.com/api/mojo/mojo-ui/ with getRaw and setRaw)

    in reply to: Observers and events #3800

    frederik
    Keymaster

    Everything is depending on the font you want to use and the character unicode mapping inside that font.

    you can use something similar:

    ## this is used internally to split inputted text to a list of glyph names based on the current font
    from lib.UI.spaceCenter.glyphSequenceEditText import splitText
    from robofab.interface.all.dialogs import AskString
    
    ## get some text
    text = AskString("input")
    print "input:", text
    
    font = CurrentFont()
    
    ## the character map
    cmap = font.getCharacterMapping()
    
    ## split the text based on the camp in to a list of glyph names
    glyphNameList = splitText(text, cmap)
    
    print "as glyph names list:", glyphNameList
    
    ## loop over the glyph names asks for their unicode value in the current font
    ## convert it back to text based on that unicode value
    backToText = u""
    for glyphName in glyphNameList:
        if glyphName in font:
            glyph = font[glyphName]
            if glyph.unicode is not None:
                backToText += u"%s" %(unichr(glyph.unicode))
            else:
                backToText += "/%s " %glyphName    
        else:
            backToText += "/%s " %glyphName
    
    print "backtoText:", backToText
    
    

    hope this makes sense.

    in reply to: Observers and events #3784

    frederik
    Keymaster

    This is a feature planned feature for the next version.
    Something similar like tools and his observers for the Glyph View but enhanced for Space Center.

    (see http://cl.ly/ExxK :)

    It is possible but it will be with some detours….

    in reply to: Unable to save UFO #3781

    frederik
    Keymaster

    You can install hTool2 with your local python install. RoboFont adds local site-packages to its own system path so you can use local installed packages.

Viewing 15 posts - 406 through 420 (of 531 total)