Devanagari text rendering improperly in PyGame

I had to finally resort to a really ugly but usable workaround for my own situation. I wrote a script-fu plugin which takes a filename and a piece of text as arguments. It then writes out the text and saves it a png file using gimp. My program then loads this up and blits the png directly onto the surface.


I think is a SDL_ttf problem (the underlying component which actually renders the text).

While my IDE correctly renders the string

The SDL_TTF program does not:

There is the code: https://gist.github.com/ilario-pierbattista/be6b967b05fa2f1eb322f35988a33ad0

I'm still looking for a solution