RoboFab RSegment

Usage

# robofab manual
#     Segment object
#    usage examples

f = OpenFont()

for c  in f:
    for contour in c:
        for segment in contour:
            print segment
➔ Download this.
< RSegment for RoboFab Demo Font.R[0][0] >
< RSegment for RoboFab Demo Font.R[0][1] >
< RSegment for RoboFab Demo Font.R[0][2] >
< RSegment for RoboFab Demo Font.R[0][3] >
< RSegment for RoboFab Demo Font.R[0][4] >

Description

A Contour object is a list of segments. A segment is a list of points with some special attributes and methods.

Understanding Contours and outlines

The way outline data is organised in RoboFab, and how the various objects relate is described here: understanding contours.

Attributes

Attribute examples

# robofab manual
#     Segment object
#    attribute examples

f = OpenFont()

for c  in f:
    for contour in c:
        for segment in contour:
            print len(segment)
            print segment.type
            print segment.smooth
            print segment.points
            print segment.onCurve
            print segment.offCurve
            print segment.selected
➔ Download this.

Methods

Method examples

# robofab manual
#     Segment object
#    method examples

f = OpenFont()

for c  in f:
    for contour in c:
        for segment in contour:
            segment.move((50, 25))
➔ Download this.