RoboFab





RoboFab RKerning

Usage

f = CurrentFont()
print f.kerning
>>> < RKerning for Mailer-Regular >

# getting a value from the kerning dictionary
print f.kerning[('V', 'A')]
>>> -123

print f.kerning[('T', 'X')]
>>> None

print f.kerning.keys()
>>> [('X', 'emdash'), 
	('K', 'v'),
	('two', 'perthousand'),
	('guilsinglleft', 'a'),
	... etc.

Description

RKerning is a dictionary of kerning values. RFont makes a RKerning object when it is created and makes available as aFont.kerning attribute. The keys are tuples of the glyphs listed by their names: ('T', 'e'), ('V', 'A') etc. None is returned if the pair does not exist, rather than raising an IndexError. The parent of a kerning object is usually a Font.

Methods