Interpolate script

RoboFont Forums Help / General Interpolate script

This topic contains 2 replies, has 2 voices, and was last updated by  JBL 7 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5429

    JBL
    Participant

    Hello all,
    Not sure if this is Robofab or Robofont related:
    When I try to run this script (grabbed from robofab.com):

    # robothon 2009
    # interpolate two glyphs in the same font a bunch of times
    from robofab.world import CurrentFont
    f = CurrentFont()
    for i in range(0, 10):
        factor = i*.1
        name = "result_%f"%factor
        print "interpolating", name
        f[name].interpolate(factor, f["A"], f["B"])
    f.update()
    

    I get this error:
    interpolating result_0.000000
    Traceback (most recent call last):
    File "", line 9, in
    File "lib/fontObjects/robofabWrapper.pyc", line 3173, in __getitem__
    File "lib/fontObjects/robofabWrapper.pyc", line 3180, in getGlyph
    RoboFontError: Glyph result_0.000000 not in font.

    Any idea why? Since it says “Robofont Error”… I might as well ask here :)

    #5430

    frederik
    Keymaster

    you are asking the font for a glyph that doesnt exist

    # robothon 2009
    # interpolate two glyphs in the same font a bunch of times
    from robofab.world import CurrentFont
    f = CurrentFont()
    for i in range(0, 10):
        factor = i*.1
        name = "result_%f"%factor
        print "interpolating", name
    
        # create a new glyph
        f.newGlyph(name, clear=True)
    
        f[name].interpolate(factor, f["A"], f["B"])
    f.update()
    
    

    good luck

    #5431

    JBL
    Participant

    thank you!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Interpolate script’ is closed to new replies.