RoboFab





RoboFab RComponent

Usage

# the easiest way to get to a component
# is to get one from a glyph
from robofab.world import CurrentFont
f = CurrentFont()
g = f['adieresis']
for c in g.components:
	print c
>>> < RComponent for Excellent-Regular.adieresis.components[0] >
>>> < RComponent for Excellent-Regular.adieresis.components[1] >

Description

A component can be a part of a glyph and it is a reference to another glyph in the same font. With components you can make glyphs depend on other glyphs. Changes to the baseGlyph will reflect in the component as well. Fontographer and RoboFog called them composites. The parent of a component is usually a glyph. Components can be decomposed: they replace themselves with the actual outlines from the baseGlyph. When that happens the link between the original and the component is broken: changes to the baseGlyph will no longer reflect in the glyph that had the component.

Attributes

Attribute examples

print f['adieresis'].components[0].baseGlyph
>>> a

print f['adieresis'].components[1].baseGlyph
>>> dieresis

# move the component in the base glyph
f['adieresis'].components[1].offset = (100,100)

# scale the component in the base glyph
f['adieresis'].components[0].scale = (.5, .25)

Methods

Method examples

#method examples