If it is dlig, the user is expected to activate the ligature manually. BTW, you do not need to add the .dlig suffix, most ligatures go into dlig automatically.
What you could do, is create a class called AllLetters, set it to update automatically, and have code like this:
script latn;
language ENG;
ignore sub @AllLetters t’ h’ e’, t’ h’ e’ @AllLetters;
sub t’ h’ e’ by t_h_e;
That will substitute “the” only if:
the language is set to English (works only in software that supports languages, e.g., InDesign, but not TextEdit)
there is no preceding letter
there is no following letter
The question remains where you want to put it. Depends on the kind of typeface and intended audience. dlig (off by default) is one possibility, or calt (on by default) perhaps.
Or you could store the substitution in something like the titling feature. Assuming that in the end you’ll provide a feature overview anyway for easter eggs like catchwords.
Thanks guys, It makes sense to put it in dlig, since I’m already using calt for pseudorandom character variation. Mekkablue, if I can ask a few questions since I don’t have much (any) experience with writing opentype code manually.
A) How do i set up the class to update automatically? I mean, I can create the class and add all letters myself, but checking “generate feature automatically” wont do anything- will it?
B) The second part of the code would go into the dlig feature, correct?
Thank you!
I wanted to use and expand on your code to take into account uppercase, lowercase and mixed, plus a variety of other catchwords I’ve created. However I think I’m structuring it incorrectly despite trying various options/research, and wondered if you would please point me in the right direction.
I did this, which seems to work OK:
ignore sub @AllLetters t’ h’ e’, t’ h’ e’ @AllLetters;
ignore sub @AllLetters T’ h’ e’, T’ h’ e’ @AllLetters;
ignore sub @AllLetters T’ H’ E’, T’ H’ E’ @AllLetters;
sub t’ h’ e’ by T_H_E;
sub T’ h’ e’ by T_H_E;
sub T’ H’ E’ by T_H_E;
But then I have other catchwords and wanted to account for them too, so tried adding WITH:
ignore sub @AllLetters t’ h’ e’, t’ h’ e’ @AllLetters;
ignore sub @AllLetters T’ h’ e’, T’ h’ e’ @AllLetters;
ignore sub @AllLetters T’ H’ E’, T’ H’ E’ @AllLetters;
ignore sub @AllLetters W’ I’ T’ H’, W’ I’ T’ H’ @AllLetters;
sub t’ h’ e’ by T_H_E;
sub T’ h’ e’ by T_H_E;
sub T’ H’ E’ by T_H_E;
sub W I T H by W_I_T_H;
But typing WITHER still creates the substitution.
All tips appreciated!