canonical / Ubuntu-Sans-fonts

Other
54 stars 4 forks source link

OT Feature structure #9

Closed djrrb closed 1 year ago

djrrb commented 2 years ago

Right now there are lookups below the groups but above the features

This is fine but doesn’t seem to be compatible with how Glyphs stores features

Do we want to keep them that way?

lyubomir-popov commented 2 years ago

Is this in breach of the OpenType Layout Overview spec? From the image there, lookups seem to be children of features:

image

Disclaimer :) I know nothing abou this, but if a spec recommends a certain format, it makes sense to adhere to it, unless there are reasons not to.

The launchpad issue tracker doesn't have any information on it that I can find, so it doesn't sound community related.

djrrb commented 2 years ago

Hmmm...good question! And agree about compliance with spec.

I believe this hierarchy describes the data structure of the compiled font, whereas my question was about the higher-level feature file syntax that will compile into that.

I just found the spec for the Feature File Syntax: http://adobe-type-tools.github.io/afdko/OpenTypeFeatureFileSpecification.html#4.e

A named lookup block may be defined either inside or outside of a feature block. In either case, it may be referenced in different feature blocks. If it is defined outside a feature block, is is referred to as a ‘standalone’ lookup.

So I think having it defined outside the feature is okay, and the GSUB table it compiles into should still be compliant with the OpenType spec. (We will check GSUB-related fontbakery fails/warnings to confirm).

Still, I think it makes sense to go ahead and move them into the features when possible so that it’s easier for a future editor to see which lookups are related to which features.

(I decided to store these feature files externally so they can be reused across multiple UFOs, so my original thought about Glyphs compatibility isn’t really as much of a concern since it’ll just link to the external file rather than parsing it.)

djrrb commented 1 year ago

Including the features as an external .fea file to sidestep this issue.