Hello to all,
I am almost finished revising one of my script fonts on FontLab. There is an alternative ending "s" labeled "s.final.1". Under OpenTypeface window, I have it under "calt" feature, it reads like this:
ignore substitute s' @LETTER';substitute s' by s.fina1;This works fine.
BUT, I wanted to do the same with words ending with "os" so I created a gliph for this ligature called "o_s.fina1". Keep in mind there is also a regular ligature called "o_s" already set up to always subtitute "o" + "s" which works fine. But my final (o_s.fina1) ligature does not. I have set it up, also under calt, like this:
ignore substitute o s' @LETTER';substitute o s' by o_s.fina1;and as I mention, it does NOT work and I don't understand why.
I would appreciate any tips to make it work, please.
Kind regards
Comments
ignore substitute o_s' @LETTER;
substitute o_s' by o_s.fina1;
Be sure that your calt feature comes after your liga feature, otherwise o_s will never be found when calt runs.
Regards
AND, only one glyph or class in a substitution may be marked in this way. On a couple of your "ignore" lines, you've got tick marks on more than one thing. It should only be attached to the glyph or class you intend to substitute.
Plus, this could be simplified tremendously by using classes.
Something like this should work:
Naming and defining those classes separately would make writing and editing easier.
I pasted your text and added a few more. I followed your advise created a class for init with l and e, é, è, ë, ê. Also a class for fina for s, os, ós, òs, ös, õs, ôs.
The inital l and the initial e work with all letters except with the regular l and e themselves, meaning I can write "lot" and "eat", but not "let", "ela" "eel", nor "llet"
Also, the final s does work but os and its derivatives do not. PLEASE HELP!
This is what I wrote (or pasted) based on your text, (I do not get errors when I compile):
feature calt {
lookup initials {
ignore sub @LETTER [e egrave eacute ecircumflex edieresis l]';
sub [e egrave eacute ecircumflex edieresis l]' by [e.init egrave.init eacute.init ecircumflex.init edieresis.init l.init];
} initials;
lookup finals {
ignore sub [s o_s ograve_s oacute_s ocircumflex_s otilde_s odieresis_s]' @LETTER;
sub [s o_s ograve_s oacute_s ocircumflex_s otilde_s odieresis_s]' by [s.fina o_s.fina ograve_s.fina oacute_s.fina ocircumflex_s.fina otilde_s.fina odieresis_s.fina];
} finals;
} calt;
thanks in advance
Regarding the finals lookup, the o_s et al. substitutions will only work if the liga feature comes before the calt feature, so that the ligatures are already present in the text stream to be targets for the calt lookups. (Mark mentioned this important condition in his first response.)
I *think* those are the causes of your problems.
feature calt {
lookup initials {
ignore sub @LETTER [e egrave eacute ecircumflex edieresis l]';
sub [e egrave eacute ecircumflex edieresis l]' by [e.init egrave.init eacute.init ecircumflex.init edieresis.init l.init];
} initials;
lookup finals {
ignore sub [s o_s ograve_s oacute_s ocircumflex_s otilde_s odieresis_s]' @LETTER;
sub [s o_s ograve_s oacute_s ocircumflex_s otilde_s odieresis_s]' by [s.fina o_s.fina ograve_s.fina oacute_s.fina ocircumflex_s.fina otilde_s.fina odieresis_s.fina];
} finals;
} calt;
feature calt {
script latn; # Latin
lookup initials {
etc.
Can you provide an example that shows what you want to achieve?
What I would do in this case is, instead of doing substitutions of ligatures in <calt>, add a substitution for the results of <calt> in your <liga> feature. In other words, add "sub o s.fina by o_s.fina;" to <liga> and remove "o_s" and "o_s.fina" from your <calt> feature, and do the same for your other ligatures of alternates.
OpenType substitutions work a bit like a search and replace macro in a word processor. The order is important. You have to be careful that what you're trying to match might not be there yet, or that it might have already been substituted with something else by an earlier lookup.
The inital l and the initial e work with all letters except with the regular l and e themselves, meaning I can write "lot" and "eat", but not "let", "ela" "eel", nor "llet.
I think that's about it!
Thanks
This way you don't have to define exceptions, which make the OpenType features a lot easier to read and maintain.
This forum topic at our website shows how it is done with FontCreator:
http://forum.high-logic.com/viewtopic.php?p=26623#p26623