Optical Kerning technique for complex Arabic urdu fonts using external tool

I am thinking to get developed a tool for generating auto kerning in complex Arabic / Urdu fonts. I think it is impossible to generate kerning pairs and implant kerning within the OTF font file for complex scripts fonts i.e Urdu and Arabic specially Nastliq font. So I have an idea to apply auto kerning in Nastaliq and other Perso-Arabic fonts based on cursive positioning. This will be done by external Tool, script or software. Here is detail of this process.

1. First We have to define a character for Negative space in our font file. for example, I will define an empty glyph named as "negativespace" in my font and Assign Unicode value from private area i.e (U+E000
) to it. Then I will assign kerning value -50 to it. when user will type "negativespace” the next letter/word will be automatically kerned to -50. when user will re type "negativespace" the next letter/word kerning will be increased by -50 and become -100 in total. by typing "negativespace" again and again user can get manual kerning whichever point is required. 

2. Now we are going to automate this process. For this we will need an external tool/script/software.  

This tool will interact with the selected text of any active window.

It will copy the selected text and convert it into vector outline then it will calculate distance between two shapes by decreasing the space upto the point where both shapes outline will touch each other. For example the distance between shape 1 and shape 2 is 480 then software will minus 100 from the distance (assuming that we want to maintain 100 points distance between all shapes) we will get (480-100) = 380. now software will round this figure into multiples of 50 because our kerning unit value was 50.  By rounding 380 we will get 400. It means we have to put 8 "negativespace" characters (400/50=8) to get exact optical kerning between those two shapes. Same process will be applied on all shapes of selected text. In this way we will be able to get exact optical kerning.
we can also increase or decrease the desired kerning by changing our assumed distance (100) to multiple levels 50 or 150, 200 etc. 



Can anyone can develop such sort of tool/script to get automatic kerning for urdu Arabic fonts? If anyone has a better idea to do this job exactly ?

Comments