salt or aalt?
Michael Rafailyk
Posts: 146
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;
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;
Tagged:
0
Comments
-
Someone will correct me if I'm wrong, but aalt is the place to "round up" all the features that offer alternates (not only stylistic sets but also, for example, oldstyle figs). Best practice I think is to name the feature in the aalt code rather than reproducing the sub line. So that if you had in a ss01 feature the line
sub g by g.salt;
in your aalt code you could just have the line
feature ss01;0 -
'aalt' is short for "all alternates." It is intended as a grab-bag or summation of all possible one-to-one substitutions. Everything in 'aalt' should already also be in another substitution feature. Basically the purpose is to allow an app to easily do feature like the Adobe popout of alternate glyphs in the glyph panel.
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
2 -
@Craig Eliason @Thomas PhinneyThank you so much for make it clear and for your patience with beginners. I will ask something here, only if I can't find information in the manuals.So, aalt is optional and make a reference to other features. Should it also include liga (not a single substitution)?feature aalt {
feature salt;
feature ss01;
#feature liga;
} aalt;feature salt {
sub A from [A A.alt1 A.alt2];
} salt;feature ss01 {
sub A by A.alt1;
} ss01;feature liga {
sub f i by fi;
} liga;0 -
Probably not as `liga` isn't a single substitution, but it'd be curious what'd happen if you did :-)1
-
Roel Nieskens said:Probably not as `liga` isn't a single substitution, but it'd be curious what'd happen if you did :-)1
-
It should give a warning rather than an error, but I'm still using FontLab Studio 5, so things might have changed. You can ignore this warning and the font will compile just fine.
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.1 -
One other thing about 'aalt'. There may be cases where you'll want to add actual substitutions to 'aalt' rather than just listing features. consider the following:languagesystem DFLT dflt;languagesystem latn dflt;
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.1
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 803 Font Technology
- 1K Technique and Theory
- 622 Type Business
- 444 Type Design Critiques
- 542 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 485 Typography
- 303 History of Typography
- 114 Education
- 68 Resources
- 499 Announcements
- 80 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 270 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports