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
➔ Download this.
< 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

# robofab manual
#     Component object
#    attribute examples

print f['adieresis'].components[0].baseGlyph
print f['adieresis'].components[1].baseGlyph

# 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)
➔ Download this.
a
dieresis

Methods

Method examples

# robofab manual
#     Component object
#    method examples

#method examples
➔ Download this.