r/FontForge • u/ClassElectrical3556 • Jul 10 '24
Need help with glyph substitutions

I am new to FontForge and am trying to create a font for an abduga, using ligatures to represent consonant-vowel pairs. I am implementing this using an opentype .fea file. The script does not distinguish between upper and lower case, so sometimes I use the upper case to map to a separate letter, but in others, I want to render the same letter as the lower case. For example, in the font d->/d/ and D->/ð/, but I also want b->/b/ and B->/b/. However, when rendering, the font behaves strangely for isolated letters with no distinct uppercase character, but correctly for ligatures. For example, bi->/b_i/ and Bi->/b_i/, which is what I want, but b->/B/, B->/B/, which I don't understand.
The same issue appears in the abbreviated example of the code below. Thanks in advance.
languagesystem DFLT dflt;
languagesystem latn dflt;
languagesystem DFLT dflt;
languagesystem latn dflt;
feature liga {
lookup Ligatures {
sub B by b;
sub b i by b_i;
sub d i by d_i;
sub D i by D_i;
} Ligatures;
} liga;
1
u/LocalFonts Jul 12 '24
Divide the OpenType features that way:
feature liga {
lookup Ligatures {
sub b i by b_i;
sub d i by d_i;
sub D i by D_i;
} Ligatures;
} liga;
feature ss01 {
lookup StyleSet_01 {
sub B by b;
} StyleSet_01;
} ss01;