frederik

Forum Replies Created

Viewing 15 posts - 271 through 285 (of 531 total)
  • Author
    Posts
  • in reply to: Trouble generating otf #5277

    frederik
    Keymaster

    I recommend reading the feature file syntax see http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html

    Both are warnings your font will work, but both are also easy to fix. I think the FDK warning message is very helpful.

    good luck!

    in reply to: Invalid groups #5275

    frederik
    Keymaster

    that is easy to :)

    from mojo.events import addObserver
    
    
    class RenameGroupsObserver(object):
        
        def __init__(self):
            
            addObserver(self, "checkGroupNames", "fontDidOpen")
        
        def checkGroupNames(self, info):
            print "checking group names for single quotes"
            font = info["font"]
            
            for groupName, items in font.groups.items():
                newItems = []
                for glyphName in items:
                    if "'" in glyphName:
                        glyphName = glyphName.replace("'", "")
                    newItems.append(glyphName)
        
                if newItems != items:
                    ## something changed
                    font.groups[groupName] = newItems
            print "done checking group names"
    
    
    RenameGroupsObserver()
    

    save this script in a file and add it in the preferences as a start up script and you never ever have to worry about single quotes in groups.
    see http://doc.robofont.com/documentation/workspace/preferences/extensions/

    Your font data will change and importing the UFO back in FL will change the groups behavior, off course

    good luck

    in reply to: More tools #5272

    frederik
    Keymaster

    see http://doc.robofont.com/documentation/workspace/preferences/misc/

    and set the “Maximum Tools In Toolbar” to a preferred value.

    in reply to: Invalid groups #5269

    frederik
    Keymaster

    or easier, make a script that is removing all '

    font = CurrentFont()
    
    for groupName, items in font.groups.items():
        newItems = []
        for glyphName in items:
            if "'" in glyphName:
                glyphName = glyphName.replace("'", "")
            newItems.append(glyphName)
        
        if newItems != items:
            ## something changed
            font.groups[groupName] = newItems
    

    and connect this script with event observer on fontDidOpen and it happens automatically.
    see http://doc.robofont.com/api/mojo/mojo-events/

    (RoboFont will never do this atomically cause one of the main principles is that the users should always be aware of what is happening with his/her font data)

    in reply to: Create a font object but not open #5263

    frederik
    Keymaster

    I bundled all documentation on a single html page.
    http://doc.robofont.com/the-complete-robofont-guide/

    in reply to: Create a font object but not open #5196

    frederik
    Keymaster

    I tried several word press plugins but none of them are satisfying.
    If I offer a pdf for download I would like that the download is in sync with the current documentation.

    in reply to: copy font info #5195

    frederik
    Keymaster

    do you remember which value you edited in the info sheet?

    in reply to: undo Add Component in Layer #5194

    frederik
    Keymaster

    fixed

    thanks

    in reply to: Postscript Underline Dimensions #5193

    frederik
    Keymaster

    you could set a observer when a font opens / when a fonts will generate a binary and set the value as you wish, this means it kinda atomically.

    good luck

    in reply to: Selecting glyphs in Font Over View #5192

    frederik
    Keymaster

    I just fixed this so a selection in the Font Overview is always between the previous selected cell and the current selected cell.

    Thanks

    in reply to: Postscript Underline Dimensions #5189

    frederik
    Keymaster

    as Tal stated in the ufo2fdk source code

    # fallback to None on these
    # as the user should be in
    # complete control
    

    http://code.typesupply.com/browser/packages/ufo2fdk/trunk/Lib/ufo2fdk/fontInfoData.py#L292

    in reply to: appendBPoint outputs NotImplementedError #5183

    frederik
    Keymaster

    To draw in a glyph use a pen like object
    To add or insert points use appendSegment or insertSegment

    glyph = CurrentGlyph()
    glyph.clear()
    ## grab the pen of that glyph
    pen = glyph.getPen()
    ## draw with the pen
    ## this draws a rect
    pen.moveTo((100, 100))
    pen.lineTo((100, 200))
    pen.lineTo((200, 200))
    pen.lineTo((200, 100))
    pen.closePath()
    
    ## grab the first contour
    contour = glyph[0]
    ## append a segment
    contour.appendSegment("line", [(150, 50)])
    ## insert a segment
    contour.insertSegment(2, "line", [(50, 200)])
    contour.insertSegment(3, "curve", [(100, 280), (200, 280), (250, 200)])
    
    
    in reply to: RF speed / performance #5181

    frederik
    Keymaster

    That will not change much.

    But in the next version you will be able to open a glyph window for a font that has no UI.

    from mojo.UI import OpenGlyphWindow, OpenSpaceCenter
    
    
    path = u"path/to/a/font.ufo"
    f = OpenFont(path, showUI=False)
    
    # opens glyphs "a" in a glyph window
    OpenGlyphWindow(f["a"])
    OpenSpaceCenter(f)
    
    
    in reply to: Default Font Info settings #5175

    frederik
    Keymaster

    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

    in reply to: Create a font object but not open #5172

    frederik
    Keymaster
    font = OpenFont("path/to/your/font.ufo", showUI=False)
    

    see http://doc.robofont.com/api/robofab-extras/

Viewing 15 posts - 271 through 285 (of 531 total)