You are right , no other graphics library seem to do that work even for other languages , each time a seperate font engine is used.
I have done some manual tweaking and was able to render some specific arabic text in allegro properly. ( works only with CONST char * now -- const only -- ).
to automate the process an algorithm is needed , a simple symbole replacement preprocessing
This is where i got the sdl image from https://discourse.libsdl.org/t/sdl-for-farsi-or-persian-text/25292
I talked to them and they seem to simple perform that preprocessing i just mentioned , nothing fancy
I didnt want to automate the preprocessing, i found a php library that does it ( PHP same to have the exact problem as allegro, so allegro is doing good )
after some deep understanding of this whole thing , and 12 hours of investigation i found that the best choice is to use pygame , pygame uses sdl2 internally , and i then have access so a python library that does the preprocessing
If we add some glyph hooks to allegro i will be able to implement this for allegro
I think I'd follow https://github.com/lxnt/ex-sdl-freetype-harfbuzz
HarfBuzz to translate utf8 string to a list of glyphs and position
FreeType to rasterize the needed glyphs with SDF in a texture atlas
And in a custom shader, choose output alpha using the SDF distances info in the texture
Good discussion about SDF http://www.reddit.com/r/gamedev/comments/2879jd/just_found_out_about_signed_distance_field_text/