Draft
edit

Adapted from the original RoboFab documentation.

Building an interpolation system has 2 phases: preparing it, and using it. Though this isn’t necessarily a design / production difference.

In the first phase you need to make sure that all data is set up properly, with compatible glyphs in each master, matching contours in each glyph, path directions, start point locations etc. This can be a lot of work, but FontParts can assist by reporting the problems.

The second phase – using the interpolation – comes when everything works, and rather than look for problems (there shouldn’t be any) you just want to generate all the weights as fast as possible, and get on with proofing and other things.

Interpolation requirements

Two glyphs are compatible for interpolation if they have:

  • the same amount of contours
  • the same order of contours
  • the same amount of points in contour
  • matching starting points in contour
  • matching contour directions

The following table shows the problems glyphs can have when interpolating.

  • Compatible means that the data can interpolate.
  • Functioning means that the result actually works as a glyph.

You’ll see that there are several combinations where glyphs are compatible, but the interpolation is not functional.

masters description result
Same number of points, same direction, same start point location. Compatible and functioning.
The number of off-curve points differ, but these are assumed to be on top of the on-curve when missing.
This only works for segments with 2 off-curve points.
Unusual, but compatible and functioning.
Same number of points, same direction, same start point location, same contour order. Compatible and functioning.
Different number of points. Incompatible and not functioning.
Start point is in the wrong place. Compatible but not functioning.
Different number of contours. Incompatible and not functioning.
One of the contours is turning in the wrong direction. Compatible but not functioning.
Contour order: the paths are in the wrong order. Compatible but not functioning.

Checking compatibility between fonts

  • TL;DR use Prepolator
  • Prepolator as a RoboFont extension?

Checking glyph compatibility with code

f = CurrentFont()
g1 = f['a']
print(g1.isCompatible(f['b']))
>> (False, ["Fatal error: glyph a and glyph b don't have the same number of contours."])
print(g1.isCompatible(f['c']))
>> (False, ["Fatal error: contour 1 in glyph a and glyph c don't have the same number of segments."])
print(g1.isCompatible(f['d']))
>> (True, [''])

Setting starting points automatically

g = CurrentGlyph()

for c in g.contours:
    c.autoStartSegment()
Last edited on 14/03/2018