[varLib] rename .modelFor() to .getSubModel()

Part of https://github.com/googlei18n/fontmake/issues/88
Part of https://github.com/fonttools/fonttools/issues/1355
This commit is contained in:
Behdad Esfahbod 2018-11-08 10:01:47 -05:00
parent 23c58e91d0
commit 6886075a23
2 changed files with 3 additions and 3 deletions

View File

@ -294,7 +294,7 @@ def _add_gvar(font, masterModel, master_ttfs, tolerance=0.5, optimize=True):
for glyph in font.getGlyphOrder():
allData = [_GetCoordinates(m, glyph) for m in master_ttfs]
model, allData = masterModel.modelFor(allData)
model, allData = masterModel.getSubModel(allData)
allCoords = [d[0] for d in allData]
allControls = [d[1] for d in allData]
@ -411,7 +411,7 @@ def _merge_TTHinting(font, masterModel, master_ttfs, tolerance=0.5):
cvar.version = 1
cvar.variations = []
model, all_cvs = masterModel.modelFor(all_cvs)
model, all_cvs = masterModel.getSubModel(all_cvs)
deltas = model.getDeltas(all_cvs)
supports = model.supports
for i,(delta,support) in enumerate(zip(deltas[1:], supports[1:])):

View File

@ -187,7 +187,7 @@ class VariationModel(object):
self._computeMasterSupports(axisPoints, axisOrder)
self._subModels = {}
def modelFor(self, items):
def getSubModel(self, items):
if not None in items:
return self, items
key = tuple(v is not None for v in items)