-
Notifications
You must be signed in to change notification settings - Fork 479
[varLib] Implement passing the layer name to MasterFinder #1387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Makes sense to me. Also, peple use the varLib.build() API outside fonttools already. I think we should leave that as is and add new entry point for layers. Otherwise it's an API break. |
On a second thought, this is putting UFO semantics into varLib. Not sure this is a good idea 🤔 Edit: @anthrotype just contacted me and said that he'd like to ponder the mapping of source to master OT binary some more (maybe map things explicitly in the designspace document?). So I suppose this PR is on a hold until we come to a conclusion. |
That also makes sense to me :D.
Yeah, sounds a bit hacky here. That said, here's another suggestion'ish. Use CSS-like |
I.e. use a |
I noticed that with this approach, |
so I guess we shall do this differently. Given this, we could modify varLib.build to take a DesignSpaceDocument object (in addition of a path to a designspace file) and first look at the source.font attributes, if these are already loaded TTFont objects, we can use them as master fonts, otherwise do run finder on the filenames. |
This is preparatory work for googlefonts/ufo2ft#295.
The idea is that
ufo2ft
should be able to produce sparse intermediate master OT binaries from ("brace") layers that varLib can then merge into a variable font, thanks to Behdad's sparse master work. varLib needs a way to associate a sparse "source" with an OT binary, so this PR adds passing the layer name, if existant, toMasterFinder
.To test-drive this, get smastertest.zip, extract it somewhere and do in that folder:
Side-thought: in the spirit of avoiding assigning
None
to anything, maybe thelayer_name
argument should default to"public.default"
instead?