Hi,
I’m looking for some insight into how and in which order substitution rules are applied. I read the tutorials on contextual alternates and the opentype cookbook, but can’t wrap my head around this.
When I type “AOOOA” no matter in which order I put these lines, always does only the first “O” get replaced:
# attempt 1
sub A O @default' O A by @alt; # replace second O
sub @default' O O A by @alt; # replace first O
sub A O O @default' A by @alt; # replace third O
# attempt 2
sub @default' O O A by @alt; # replace first O
sub A O @default' O A by @alt; # replace second O
sub A O O @default' A by @alt; # replace third O
# attempt 3
sub A O O @default' A by @alt; # replace third O
sub @default' O O A by @alt; # replace first O
sub A O @default' O A by @alt; # replace second O
Why does the substitution that replaces the first “O” overrule the others?
Also in another case the order confuses me:
# COE
sub @C @O @default' by @alt;
sub @C @default' @E by @alt;
sub @C @O @default' by @alt;
In the string “COE” the code above replaces the “O”. So the second rule seems to “win”.
I would expect the first rule to win, because it would turn the string to "C O E.ss01 " and the rules below wouldn’t even apply. Apparently I misunderstand how this is working
Thank you very much in advance!
Cheers
Jens
PS:
The classes used are
@default = [O E];
@alt = [O.ss01 E.ss01];
@C = [C Cacute Ccaron Ccedilla];
@E = [E Eacute Ecaron Ecircumflex Edieresis Edotaccent Egrave Emacron Eogonek];
@O = [O Oacute Ocircumflex Odieresis Ograve Ohungarumlaut Omacron Oslash Otilde ];