You can do this in defcon:
###
from defcon import Font
font = Font()
font.newGlyph("A")
glyph = font["A"]
pen = glyph.getPen()
pen.moveTo((0, 0))
pen.lineTo((100, 100))
pen.endPath()
contour = glyph[0]
for point in contour:
print point.segmentType
> --
> --
> You received this message because you are subscribed to the Google Groups "RoboFab" group.
> To post to this group, send email to
rob...@googlegroups.com
> To unsubscribe from this group, send email to
robofab-u...@googlegroups.com
> For more options, visit this group at
http://groups.google.com/group/robofab?hl=en
>
> Messages from newly joined members are subject to moderation.
> Download RoboFab and documentation at
http://robofab.com
> ---
> You received this message because you are subscribed to the Google Groups "RoboFab" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
robofab+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.