I've been working at this for hours..ugh! Sure, if there's a better way to do this, please inform. Regardless, I want to really build this script from scratch to learn.
What I want to do:
Shift points at a certain y value to a different y value.
Logical Process:
Cycle through each glyph in my font. In each glyph, cycle through contours. Within the contours cycle through points. If the point has a y value or 395, or 265, change accordingly.
--------------------------------------------------
from robofab.world import CurrentGlyph
from robofab.world import CurrentFont
font=CurrentFont()
for x in font:
print font[x.name][0]
contour= font[x.name][0]
for p in contour.points:
if p.y==395:
p.y += 100
if p.y==265:
p.y -= 100
font.update()
--------------------------------------------------
What am I misunderstanding here? When I target the contour by doing CurrentGlyph()[0], it works. So why not font[x.name][0]? Oddly enough font[x.name] is returning the value expected, but CurrentGlyph() returns the glyph that apparently belongs to "unnamed_font". And for some reason, the unnamed_font one works. Am I totally off in my approach?