robotools / fontParts

The replacement for RoboFab
MIT License
132 stars 44 forks source link

Improve kerning get and find documentation. #684

Open typesupply opened 1 year ago

typesupply commented 1 year ago

A discussion about this on the RoboFont Discord.

font = RFont(showInterface=False)
font.groups["public.kern1.Y"] = ["Y", "Y.alt"]
font.groups["public.kern2.Z"] = ["Z", "Z.alt"]
font.kerning["A", "B"] = 1
font.kerning["public.kern1.Y", "public.kern2.Z"] = 2

print(f"get: A B: {font.kerning.get(('A', 'B'))}")
print(f"get: Y Z: {font.kerning.get(('Y', 'Z'))}")

print(f"find: A B: {font.kerning.find(('A', 'B'))}")
print(f"find: Y Z: {font.kerning.find(('Y', 'Z'))}")