[FriBidi] MS-Word bidirectional behaviour

Eduardo Castiñeyra eduardo at brainstorm3d.com
Fri Dec 9 18:37:00 UTC 2016


Hi guys,

We have users in Iran who are complaining about our app not behaving the 
way MS-Word does when it comes to directional ordering.

In most applications, if one writes the sentence "In an attack of an F14 
780 people died" in Persian with no RTL marks one gets the following:

هواپیماهای F14 ۷۸۰ نفر را مصدوم کردند.

Obviously the ۷۸۰ number is missplaced, it should be on the left side of 
F14. Even if the numerals were Persian, most applications get the ۷۸۰ in 
the wrong position, and so does FriBiDi. My understanding is there is 
only two ways of fixing it

1) Force the user to insert an RTL mark after F14
2) Detect that ۷۸۰ is writen in Persian numerals and automatically treat 
it as an RTL run (maybe FriBiDi should do that?)

However, somehow MS-Word detects when the user changes the keyboard 
layout and that affects the ordering as shown in the following picture.

https://snag.gy/pbsh7g.jpg

My question is how should a FriBiDi based application handle this case. 
Maybe there is a way to force FriBiDi to detect the Persian numerals 
(assuming the numerals replacement is done before BiDi step and not at 
shaping step) or maybe we should definitely ask the user to manually 
handle this case adding the RTL mark?

Thanks!

Edu.





More information about the fribidi mailing list