In Arabic or Hebrew (supposedly in all RTL language scripts) getGlyphToCharMap returns wrong mapping. The mapping is incorrect in case of a wrapping. I checked it on the example "layout" delivered with ICU. When I change size of the window the text is wrapping from single line to many other lines. The problem appears only on RTL languages that the mapping for first indexes line is at the end in Unicodes. Below I tried to visualize the problem in the tables in the following format [number_glyph_in_single_line]:[glyph_index]:[mapping_getGlyphToCharMap_for_the_glyph]
Correct mapping (breaking line is not used)
Incorrect mapping (breaking line is used)
Incorrect mapping should be correct as below:
I attached paragraph_bad_mapping.PNG, paragraph_good_mapping.PNG, Sample.txt and FontMap.GDI files
I'm reopening this because Alexis Tamas at STG Interactive found that the fix did not work in all cases. In fact, the original fix only works if the whole paragraph is right to left text.
This bug is now ready for review.
Milestone 3.9.1 deleted