at first i should thank you because of sharing the class
but this is not a class at all , just a function to return true type of persian text , even the file you attached here has no class name ! and it contains syntax error
if it is a class for writing persian on images , then it would be nice to compelete this and attach another example file with it on how to use it .
i used your function and it did revers the text but i couldnt show persian texts on image file !