|
Problem wiht non english text drawing |
Mustafa S.
Member #14,185
April 2012
|
hello everyone.. the result should be مرحبا I included snapshots for a correct rendering and the rendering I'm getting from allegro.. I'm not sure how to fix this and if this bug is from the library being used in allegro.. thanks |
Elias
Member #358
May 2000
|
Allegro's ttf addon has no rtl support right now. Could that be the problem? -- |
Peter Wang
Member #23
April 2000
|
We would also need a smarter way to convert the string into glyphs, I think, due to the different letter forms depending on where they appear. Do we need to create an addon using Pango? edit: attached test programs for fun. One using the pango-cairo backend, one using pango-freetype backend.
|
Mustafa S.
Member #14,185
April 2012
|
thanks for the response guys.. @Ellas from the way I understand how arabic character are encoded.. there are 4 or less representation for the same character for example م which is M in english pronounced "meem" Isolated ( م ) UFEE1 and from what I believe that all representations are included in utf8 so when rendering م the render library should render it as different latter based on it's position in the word ,, but based on the result it's always maps م to UFEE1 without caring about it's position.. @Peter can you attach a snapshot.. it seems that I'm having a hard time compiling the code not knowing what to include.. :/ thanks again guys for the help.. I just want you to know I'm just pointing this out and it's not that important for me.. but it's always fun to share problems & solution.. |
Peter Wang
Member #23
April 2000
|
Attached screenshots. To compile you need something like: gcc ex_pango.c $(pkg-config --cflags --libs pangocairo allegro-5.0) The second one uses a feature from Allegro 5.1, and you need pangoft2 instead of pangocairo.
|
Mustafa S.
Member #14,185
April 2012
|
@peter thanks.. @Ellas.. I generated the the assembly code for my program.. and it seems that the string stored in memory as |
Peter Wang
Member #23
April 2000
|
Exactly. The Allegro TTF addon is not smart enough for complex scripts. It just draws each code point one at a time from left to right, so for Arabic there are at least those two problems to solve. I would like Allegro to have a built-in solution, but in general it will be too much work to do it ourselves. That's why I'm thinking about a new addon using pango. It would not replace allegro_ttf, which is sufficient for many users and probably easier to install on platforms other than Linux. I don't use Ubuntu but if you search for pangocairo you should be able to figure out the packages.
|
|