-
Notifications
You must be signed in to change notification settings - Fork 448
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
Support Glyphs App “standalone” lookups #3335
Conversation
d1a960d
to
0b2480a
Compare
Thanks Khaled, sorry, I know you did not come up with this so I don't blame you... but I really dislike this. |
I don’t like it either, and if it were up to me I’d drop all the inline and implied lookups from FEA syntax, they have always been a source of trouble. Feature blocks should contain lookup references only. But:
|
I think the functionality is really needed (I’m open to change the syntax if someone has a better idea). Otherwise stuff gets scattered all over the place. Mostly when doing chaining pos/sub stuff. There you need to define a lookup that is not directly included in a feature record. Without this, those extra lookups have to be defined outside of the feature and that can be hundreds of lines away of where it is used (the problem is a tiny bit exaggerated in Glyphs because there is not "outside of the feature", but that doesn't make a bit difference). |
But let's be realistic: it is mainly needed because of a particular detail of how Glyphs works. I find that a very poor reason to just go and add new syntax. Regardless of the poor track record of FEA standardization. |
As I said. This is another argument but not the reason. |
It is much nicer to have this next to each other:
And having it in a Prefix in Glyphs is even less annoying as to have it somewhere else hundreds of lines away. Features for Indic scripts or Arabic can be VERY long and confusing already. |
A Glyphs App extension that allows defining lookups inside feature blocks without referencing them (i.e. as if the lookup was defined outside of the feature block). https://handbook.glyphsapp.com/en/layout/standalone-lookups/
0b2480a
to
49f8e2a
Compare
glyphsLib already does a bit of regex to massage and join up the features.fea when translating .glyphs => UFO, I believe it could could take the responsibility to move these "standalone" lookups out of the feature blocks in their own prefix. |
It is not as simple as some regex substitution, as the lookup order needs to be preserved and lookup flags needs to be carried over. |
to preserve the lookup order glyphsLib could turn all the lookups as true standalone, and replace the inline ones (inlcuding the so-called "standalone") with references. I'm not sure what you mean by "lookup flags needs to be carried over". |
I’m still not convinced. Philosophical purity aside, supporting this does not cost us much, and closing one compatibility gab is an overall one. Supporting this in glyphsLib requires duplicating feaLib.parser or subclassing it in ways it was not intended for, making things more complicated for no much gain. |
fea-rs would need an update as well. Do we have evidence of the "standalone" syntax being used? At what scale? |
AFAIU the lookup order of chained-to lookups doesn't matter. So the whole reasoning in https://handbook.glyphsapp.com/en/layout/standalone-lookups/ sounds dubious to me. I understand and share Cosimo's frustration, but also empathize with Khaled's desire for supporting .glyphs sources as much as we can. If it was up to me I would have probably accepted this. |
The alternative would be to do it in glyphsLib as Cosimo suggests. @khaledhosny lookup order is irrelevant isn't it? What else would feaLib need to allow glyphsLib to subclass the parser, transform the AST, and write it as legal .fea? Maybe the same mechanism can be applied to googlefonts/glyphsLib#800 as well... |
Gentle reminder that this feature is mainly driven by a limitation in Glyphs, and not by an objective need for improvement. |
Maybe a regex is all we need after all... |
This is not true and I explained that already (having the extra lookup in a "Prefix" in Glyphs makes it even easier to get to them editing). The main reason is to keep the functional parts of the feature code together. Specially Arabic fonts can have a lot of contextual substitutions. Having the actual and the chaining lookup just next to each other can streamline working on it. One thing that I’m open to change is to move the "standalone" after the "lookup" keyword.
|
|
|
That's my personal preference, to at least not introduce a new keyword. I'm going to experiment with subclassing the feaLib parser in glyphsLib and see if I can rewrite the .fea. |
If Glyphs.app Features panel allowed one to write a "prefix" immediately before the current feature, this issue would be solved and we wouldn't need any extra keyword. Please consider adding some option in the currently selected feature panel, say next to "active" and "generate feature automatically" checkboxes, which when selected would show the enclosing |
if one wants those two lookups to be close to one another, one could define both of them outside of the feature block, not just the standalone one but also the lookup that references it; then inside the feature block you simply reference the contextual lookup. I don't see a problem with that, it's more explicit and gives you exact control over when lookups are defined and when they are applied, avoiding the define-and-apply-at-the-same-time issue of named lookup defined inside a feature block. |
But then you still need to hunt around to see what is going on. Making sense of those files is quite annoying. I get those now and then and people ask why things are not working. And they are not working because of the lookup order or just because they confuse things. |
The whole “modern” font building pipeline is shaped by font editors limitations. Like we are fighting with feature files because FontLab 4 didn’t have an OpenType UI and UFO just followed suit. The whole UFO format is a glorified serialization of of FontLab 4. All the mess of feature file with all its gotchas is probably because Adobe didn’t have an OpenType editor (and probably couldn’t use VOLT) so wanted a hand-editable format instead of a proper structured one. |
Even if the order of the chained lookup is unimportant, the order of the contextual lookup often is. So going this route, one ends up defining everything in a prefix and not using feature blocks at all. But folks don’t want to do this (you miss automatic features, and the UI to set ssXX feature names, etc.). I really don’t understand the strong opposition. It is an ugly hack, I don’t like it either, but what is the big deal! I’m in the business of making fonts and helping people make fonts, that is the end goal: fonts in the hands of the users. The tools to do this are means to and end and as long as this addition does not affect FontTools maintenance in a bad way, I don’t see why wee need to think of all other complicated alternatives to not do the simplest thing. |
I don’t have data. I needed to use it in a project and I thought it would be nice to be still able to build the font with fontmake. |
I don’t know. The one time I used it was actually to preserve the lookup order of an earlier build of a font to avoid needless changes. |
A Glyphs App extension that allows defining lookups inside feature blocks without referencing them (i.e. as if the lookup was defined outside of the feature block).
https://handbook.glyphsapp.com/en/layout/standalone-lookups/