I'm running into a problem with the way in which FontLab Studio orders GSUB features, and I suspect it is because I don't really understand how GSUB lookups are actually implemented. I've got some features which rely on lookups which are defined in other feature definitions, and FontLab isn't ordering those features the way in which they appear in the OpenType window. The general structure of the relevant portion is as follows:
feature fea1 {
lookup A { ... } A ;
lookup B { ... } B ;
} fea1 ;
feature fea2 {
lookup B ;
lookup C { ... } C ;
lookup D { ... } D;
} fea2 ;
feature fea3 {
lookup B ;
lookup E { ... } E ;
lookup D ;
} fea3 ;
feature fea4 {
lookup B ;
lookup F { ... } F ;
lookup E;
lookup C ;
lookup D;
} fea4 ;
The problem which I am running into is that FLS is determined to place feature 'fea2' after 'fea4' despite the order in which I've placed them. I'm assuming that this has something to do with the fact that lookups are being called across features, but I don't understand why I can call features defined in 'fea1' and 'fea3' in 'fea4' and have them ordered as I've requested, while 'fea2' is bumped to the end. All of the lookups involved are contextual substitution rules (GSUB type 6) except for lookup A which is GSUB type 1.
My current workaround is to simply redefine each of the lookups in each of the feature blocks, but this seems rather inefficient. Can someone give me some pointers on where I can get an explanation of what's going on here? If there's something in the FSL manual or in Adobe's OT spec I seem to be missing it.
TIA,
André