views:

230

answers:

1

I am able to display chinese character correctly but when I try to display arabic string the output that display in OpenGL scene is different from the arabic string that display in Visual Studio Editor. I know it should be something to do with "Complex Script" but I am not able to find any good example regarding to this matter. I would like to know how to display arabic text correctly?

+3  A: 

Unlike Latin characters which each have a single visual representation, each Arabic character can have many different appearances depending on the surrounding characters. The logical characters in an Arabic string need to be converted to a sequence of visual glyphs in order to be correctly displayed. OpenGL doesn't do this processing for you so you're seeing the logical characters rendered without this processing.

To get around this you will need to use a library such as Uniscribe to transform the logical string into a visual string which you then give to OpenGL for rendering. There are some samples here.

GraemeF
very informative - thanks
Phil Nash
Thanks for the hints. I think I might get a few day to study on it.