So we have:
descriptor.filename: the path to the UFO, relative to the documentpath
descriptor.path: the resolved, absolute path to the UFO
This means we have to be aware of a couple of situations, described in updatePaths() and testPatgNameResolve().
Case 1: both filename and path attributes are None. Action: write the descriptor as is, without filename attr.
Case 2: filename attribute points somewhere, but the path attribute is None. So we can't actually verify if the UFO really exists, but we don't have to. Action: write the filename attribute as is. We could calculate a new path though.
Case 3: filename attribute is None, path attribute has a path. So there is no legacy value for filename that we need to look out for. Action: we can calculate a new relative path and store that in filename.
Case 4: filename and path attributes are not None, but they're in conflict, pointing to different places/ So the absolute path of the UFO and the absolute path of the document produce a different relative path than is stored in filename. One of them must be wrong.
When a new filename is set, make sure to set the path attribute to None and vice versa.
- self_strictAxisNames controls whether unknown axis names are ignored when reading locations.
- if we don't have any axes in the document then we don't know the axis names, but we still need to read locations.
- after reading all locations we can then reconstruct axis objects.
- also set the copyInfo flag after choosing one.
__removeAxesFromDesignSpace(path) takes a designspace path, reads the file and deletes the <axes> element. This is to make a test file for reading a file without axes.
- mutators for info, kerning and glyphs are lazily constructed. Only make them if they're asked for.
- getInfoMutator() makes / returns info mutator.
- getKerningMutator() makes / returns kerning mutator
- getGlyphMutator() makes / returns glyph mutator
- loadFonts attempts to load the master UFOs and determine the defautl font by looking for the copyInfo flag, or if that is not found, by using mutator's findBias. Will warn if there is a conflct, but the copyInfo flag is leading.
- makeInstance() returns a font object for the asked location. You can decide to save it or not elsewher.
- generateUFO() makes UFOs on disk for all defined instances.
Still largely untested. Note: this requires an updated mutatorMath.
- aims to do work the same way as mutatorMath.ufo.document
- generate all instances as UFO
- handle glyph masters, info, kerning, lib
More testing is needed.