Hi TypeDrawers!
Just figured out that salt and aalt features can doing the same substitution. What the difference between them and in which cases do I need use each of? For example, which one feature work better to allow the user to choice an alternate by selecting a character in the text?
feature salt {
sub A from [A A.alt1 A.alt2];
} salt;
feature aalt {
sub A from [A A.alt1 A.alt2];
} aalt;
0
Comments
sub g by g.salt;
in your aalt code you could just have the line
feature ss01;
The need for 'aalt' to even exist has been reduced by apps being smarter and constructing their own such lists from all other features.
So in most cases the right answer is:
- use whatever other feature you are thinking might be appropriate
- optionally use 'aalt' to include all substitutions you put in any other single substitution feature
feature salt;
feature ss01;
#feature liga;
} aalt;
sub A from [A A.alt1 A.alt2];
} salt;
sub A by A.alt1;
} ss01;
sub f i by fi;
} liga;
Note that the use of the feature keyword inside 'aalt' is just a convenience. It doesn't correspond to anything that actually exists in the GSUB table. The compiler generates a bunch of 'sub X from Y' substitutions drawing on the set of substitutions found in all the features listed inside aalt. If you're a masochist, you can create all these substitutions yourself.
If the features listed in 'aalt' include contextual substitutions, the contexts will be ignored. If they include ligature substitutions, those will be ignored altogether.
lookup foo {
sub a from [a.alt a.alt2];
} foo;
feature aalt {
feature salt;
} aalt;
feature salt {
lookup foo;
} salt;
At least in FontLab studio 5, the above will result in an empty 'aalt' feature, because any substitutions which occur in lookups declared outside of a feature block will not be included, even if those lookups are referred to in features blocks which are included in aalt. So you'd have to manually add the sub a from [a.alt alt2] to 'aalt'.
I don't know if things have changed in FontLab 7. I paid for FontLab 6, and hated it so much that I went back to FontLab 5.