I am nearing the end of a project I'm doing using Opentype features in an experimental way. I call it experimental because my usage isn't particularly informed and there's probably a much easier way to be doing this. That's where I'd like your help.
I have set myself up to translate (I use translate very loosely) "txtspeak" into normal english (hereby called 'txt' and 'text'). I have beginners knowledge of coding Opentype features and my idiocy will probably make a lot the experts squeal, but I don't mind that. Current ignorance has proven to be experimental bliss, but I'm more than willing to dive into deeper grounds to rectify problems I think I will ultimately come across.
So far I've used "calt" to swap words from the 'txt' spelling into 'text' spelling i.e. "txt" into "text", "shizz" into "stuff" and so on. I've also used "dlig" to swap profanities into asterisked words (I won't be as rude to give an example of that).
Here's where you cringe: I've told the "calt" feature to
sub d d n t space by d_i_d_n_singlequote_t_space ;
For the "ddnt"»"didn't" this has worked great as it has with "shiz"»"stuff" and a few others. I came across a problem when I tried "iz"»"is" because the spaces either side of "iz" when typing were, or rather could be, eaten up by translating a word before it. So, the code became
sub space i z space by space_i_s_space ;
sub i z question by i_s_question ;
sub i z exclam by i_s_exclam ;
sub i z period by i_s_period ;
sub i z comma by i_s_comma ;
sub i z space by i_s_space ;