ufoProcessor
ufoProcessor copied to clipboard
Support for Designspace 5
These are my notes for the work that needs to be done to support DS5. Please discuss.
Read and write designspace 5
- Work with the fonttools designspace descriptors, but also support descriptors that are not subclassed.
- support interpolation axes + discrete axes
- that means there can be multiple, incompatible spaces contained in this designspace
- maybe the coordinates on the discrete axes can serve as a selector for a continuous space
Provide interpolation sevice through mutatormath / varlib for all geometry
- glyph geometry
- kerning
- kernlets
- font.info
- selected registered font.lib keys with geometry
- provide mutators for external use
Generating UFOs
- Up to now ufoProcessor would attempt to execute the rules by swapping glyphs and kerning to keep the appearance as expected. Now that rules are more complex it might not always be possible to build a single UFO that fits the expectations. So I propose to limit the scope of the UFO output: do not try to interpret the rules, but leave all kerning, glyphs, geometry as it follows out of the interpolation. This is useful for making new masters, extrapolating etc.
- Dropping support for executing rules will disrupt processes that rely on building "visually complete" ufos.
- Generating UFOs with "executed rules" should be done by compiling the features / GSUB. Perhaps there are other tools that provide that service.
- Question whether this should support the "user coordinates"
Mutatormath
Continued support for MutatorMath-style interpolation, including anisotropic coordinates is needed as this would be the only way to make extrapolations and anisotropic transformations.
@miguelsousa would you be ok with dropping the support for executing the rules when generating ufos?
@LettError thanks for bringing this effort to my attention. I'm no longer involved with font production; I trust @frankrolf, @punchcutter, @josh-hadley, @kaydeearts, and @skef will be able to provide an answer.
Test designspace + fonts and some exploring added in #ds5 https://github.com/LettError/ufoProcessor/blob/23297c71789ef04c9f220ae5278a0496c366f3de/Lib/ufoProcessor/init.py#L975
I was worried this change would interfere with the buildcff2vf tool (part of the AFDKO), but after a short conversation with @LettError I understood this really only affects the rule processing when creating UFO instances (so no more concern here).
I am curious – what workflow would you now use to create instance UFOs with rules processed (the infamous dollar swap, for example)?
If the system can compile features:
- generate UFO
- compile features
- for each UFO, see what
rvrnor other rule glyphswapping feature of choice would do - swap those glyphs
If the system can not compile features it should could use https://github.com/LettError/ufoProcessor/blob/c7c39f5746c3228783e0fe776a412b9970e77ae3/Lib/ufoProcessor/init.py#L144
It might be useful to rebuild this in some way for the shiny new UFOOperator.
UFOOperator does:
- mutatormath / varlib
- extrapolation for MM / VL
- anisotropic for MM / VL
- discrete locations everywhere
- generate UFOs
- generate single glyphs, with some options
- generate font dimensions (a small font.info)
- generate mutators for glyph, info, kerning
- caching
To do:
- kernlets
- selected registered font.lib keys with geometry