Moving out of CFF code, to be used in VariationModel(). Part of https://github.com/fonttools/fonttools/issues/2213