Ya Ra Va Signs
Last updated
Last updated
In Malayalam, the Ya, Va and Ra signs when appeared together has an interesting problem. The Ra sign is prebase sign, meaning, it goes to left side of the consonant or conjunct to which it applies. The Ya and VA signs are post base, meaning it goes to the right side of consonant or conjunct to which it applies. So, after a consonant or conjunct, if Ra sign and Ya sign is present, Ra sign goes to left and Ya sign remain to the right. This is same, irrespective of the order of ya and ra.
To understand this issue better, let us take the example of เด + เตโเดฐ + เตโเดฏ and เด + เตโเดฏ + เตโเดฐ. The below image illustrates the steps this combination goes through in rendering. An example word with เด + เตโเดฐ + เตโเดฏ can be transliteration of crew - เดเตเดฐเตเดฏเต. เดธเตเดตเดพเดคเดจเตเดคเตเดฐเตเดฏเด is another word where this Ra sign, Va sign combination appears. There is no valid word for เด + เตโเดฏ + เตโเดฐ, but that is not much relevant to a font. It is supposed to render any sequence without errors. If both เด + เตโเดฐ + เตโเดฏ and เด + เตโเดฏ + เตโเดฐ are producing same rendering it is a bug.
This bug was present in SMC's Manjari, Chilanka, Gayathri fonts(all share same opentype tables). The issue is also present in Ra sign, Va sign combination as illustrated in the below image.
I had noticed this issue in 2018 and reported: "เดธเตเดตเดพเดคเดจเตเดคเตเดฐเตเดฏเด เดธเตเดตเดพเดคเดจเตเดคเตเดฏเตเดฐเด rendered same". I did not give much importance to it since has relatively small impact. But recently Jon Hudson asked me about this in twitter. That prompted me to solve it.
The fix is not complex. It involves a conditional replacement of Ra sign with Virama + Ra when appeared after Ya sign or Va sign. The replacement can be done using a multiple substitution rule. The Noto Sans Malayalam font from Google also address this issue in exactly same way.
This fix is available in latest versions of Manjari, Gayathri and Chilanka. The issue is present in other fonts of SMC too, but not fixed yet.