RoboFab





RoboFab RSegment

Usage

f = OpenFont()

for c  in f:
	for contour in c:
		for segment in contour:
			print segment
>>> < 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. See the LettError wiki for a comprehensive explanation of segments.

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

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
    

Methods

Method examples

f = OpenFont()

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