I'm working on a font, creating a glyph based system, based on IPA input, using Consonant-Vowel pairs, as well as Vowel-Consonant pairs.
Each "sound" is mapped to a glyph, and each pair is overlaid on top of the other. If a consonant precedes a vowel, the vowel glyph is overlaid on top of the consonant. Vice versa, if the vowel precedes the consonant, then the consonant glyph is overlaid on top of a vowel glyph, but the vowel changes to an alternate form with a diacritic attached to the bottom.
My kerning is set to reflect that, overlay the preceding glyph ontop of the former, and any consonant-consonant and vowel-vowel pairs are left alone.
I have a rule set up that if a vowel is followed by a consonant to change it to the alternate glyph, and that works okay. Consonant-vowel pairs work right too. Everything is good until a word hits a vowel-consonant-vowel sequence, in which it should combine the alternate vowel with a consonant, but the problem is that it sees the consonant and second vowel as a valid pair, combines them, and overlays all three on top of each other, breaking the rest of the word from that point onwards.
Is there any way to get the lookup to only look for a pair, combine them, then start anew? Most everything is working correctly aside from that hiccup. I'm not versed in scripting directly, and I'm unsure of what to do. I have the contextual rules following one another in a set, but even if I separate them, it still acts the same, so I don't think that matters. If anyone can help, it'd be much appreciated.
As a secondary question, and not entirely necessary to answer, but I have the vowels set to each have their contextual alternate forms as separate glyphs, but is it possible to replace all of these with just a actual diacritic mark that gets placed beneath when the vowel-consonant pair is detected?
Comments
In an AFDKO implementation, you might need to add an IGNORE context to your consonant-vowel lookup, so that it will not be triggered if preceded by the vowel with which the consonant combines.
As to your second question, yes, you could substitute your vowels to combining marks and then position those using mark-to-base anchor attachments.
sub @vowels' lookup Vowel_First_CAlts @consonants;
How would you expect your system to behave with a consonant initial word like 'Topeka' or 'Kansas' or with a word with a particularly evil syllable structure like 'sixths'?
You should be able to kern Theta against itself just fine, though!
I have prioritized C-V pairs over V-C. I'm using both. The font worked fine up until it hit a V-C-V pattern, in which it was seeing both a V-C and C-V pair, and subsequently laying them on top of each other. But, per Christian's suggestion, I made duplicates of the consonant glyphs, and whenever a V-C pattern is detected, it replaces the consonant with an identical copy of the glyph, so that it's no longer seeing it in the same way, yet seeing it as a V-Alt-C-Alt set instead.
Because it's not just the kerning that's an issue, as with the word ˈθʌndər (thunder), it should be producing ˈθ+ʌ n d+ər. As it is, it's not seeing Theta as a consonant, even when I've got it in a consonant group set, so it's producing ˈθ ʌ+n d+ər, switching the ʌ to it's alternate, when it should be overlaid on top of Theta.
Your viable options include:
- get rid of the Theta
- encode all your characters in a private use area instead of using pre-existing codepoints