# robofab manual
# Contour object
# usage examples

# take a glyph (one with outlines obviously)
c = CurrentGlyph()

# get to contours by index:
print c[0]
< RContour for Mailer-Regular.a[0] >


RContour is an object for, well, contours. A contour is a single path of any number of points and shape. A glyph usually consists of a couple of contours, and this the object that represents each one. The RContour object offers access to the outline matter in various ways. The parent of RContour is usually RGlyph.

Understanding Contours and outlines

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


If you want to add new contours to a glyph it’s easier to draw them with a pen than to construct the shapes from segments.



The index of the contour in the Glyph.


Returns 1 if the contour is selected, 0 if it isn’t.


The bounding box for the contour. (read only)


Direction of contour: 1=clockwise, 0=counterclockwise.


The contour as a list of Point‘s.


The contour as a list of bPoint‘s.

Attribute examples

Examples with contours and points here.

Methods for segments

For regular drawing in glyphs: please use Pens. If you want to mess with segments on a lower level, be our guest:

appendSegment(segmentType, points, smooth=False)

Add a segment to the contour. Parameters?

insertSegment(index, segmentType, points, smooth=False):

Insert a segment into the contour.


Remove a segment from the contour.


Set the first node on the contour.

Methods for points

appendBPoint(pointType, anchor, bcpIn=(0, 0), bcpOut=(0, 0))

Append a bPoint to the contour.


Automatically set the lower left point of the contour as the first point.

insertBPoint(index, pointType, anchor, bcpIn=(0, 0), bcpOut=(0, 0))

Insert a bPoint at index on the contour.

Other methods


Reverse contour direction.


Duplicate this contour.


Draw the object with a RoboFab segment pen.


Draw the object with a point pen.

move((x, y))

Move the contour.

pointInside((x, y), evenOdd=0)

Determine if the point is inside or ouside of the contour.


Round the value of all points in the contour.

scale((x, y), center=(0, 0))

Scale the contour by x and y. Optionally set the center of the scale.

rotate(angle, offset=None)

Rotate the contour by angle (in degrees). Optionally set an offset value.

skew(angle, offset=None)

Skew the contour by angle (in degrees). Optionally set an offset value.


Transform this contour. Use a Transform matrix object to mess with the contour. See also how to use transformations.

Method examples

# robofab manual
# Contour object
# method examples