Add an anchor

  • try this:


  • thanks Thom that works,

    now I just need to figure how to turn on measurements with python

  • admin

    As measurements are a UI related attribute, it is not added to the robofab-like guide object.

    However you can change the display of measurements of a guide with:

    glyph = CurrentGlyph()
    guide = glyph.addGuide((100, 100), 90, "my guide")
    guide.naked().showMeasurements = True

    to remove all guides you can also use glyph.clearGuides()

    good luck!

  • admin

    and from a programming point of view it is maybe better to use range(start, end, steps)

    # print out an angle between 0° and 360° in steps of 15
    for angle in range(0, 360, 15):
        print angle

  • Sorry --> double post

  • Frederik, you are the man! I really appreciate the programming point.

    That being said I want to report a bug. >_<
    When you set the measurements via the scripting window it isn't reflected in the WYSIWYG editor, even after CurrentFont().update().

  • admin

    mm, I cannot reproduce this bug

    sample script:

    glyph = CurrentGlyph()
    for a in glyph.anchors:
        for angle in range(0, 180, 15):
            guide = glyph.addGuide((a.x, a.y), angle)
            guide.naked().showMeasurements = True

  • Well this is what I used (

    PS. How do I enable PrettyPrint on my code?

    # Add Radial Guides - Quinn Keaveney
    g = CurrentGlyph()
    ancs = []
    gd = []
    for angle in range(0, 180, 15):
        gd.append("Radial {0}deg".format(angle))
    for a in g.anchors:
        b =
    if 'Radial Guide' not in ancs:
        g.appendAnchor("Radial Guide", (500, 500))
    for a in g.guides:
        if in gd:
    for a in g.anchors:
        if == 'Radial Guide':
            x = a.x
            y = a.y
            for angle in range(0, 180, 15):
                g.addGuide((x, y), angle, name=("Radial {0}deg".format(angle)))
                guide = g.addGuide((x, y), angle, name=("Radial {0}deg".format(angle)))
                guide.naked().showMeasurements = True
    print ''
    print 'Digested by Python.'

  • admin


    import pprint
    data = [["nested Item1", "nested Item2", "nested Item3", "nested Item4"], "item1", "item2"]

    good luck!

  • Thanks!