Hi all,
As you may know (I make a lot more noise than actual work), I am trying to implement BiDi support for WINE. The most promising place to start seemed to be GetCharacterPlacement, that does everything even remotely BiDi related. The most immediate thing to do was to call GetCharacterPlacement from ExtTextOut in order to do the BiDi rearrenging.
In typical MS fashion, however, it seems that this will not work. Despite the fact that you are supposed to be able to call GetCharacterPlacement once, and then call ExtTextOut with the result as many times as necessary (speeding up the process, and suggesting that GetCharacterPlacement can do anything ExtTextOut can do), it seems there is one thing that ExtTextOut is expected to know how to do, and GetCharacterPlacement does not know. For those who are really interested, this is specfying the base directionality of the paragraph.
I am pretty sure the way Windows implements this is by having a common parent function used for reordering by both ExtTextOut and GetCharacterPlacement. I think such an arrangment is awfully crude. I was considering an alternative solution, and would like your opinion.
What I thought of doing was adding a bit to the flags GetCharacterPlacement gets, which says "right to left paragraph, if you'll be so kind". My question is - how acceptable is such a behaviour. Is that a huge no-no, or is that a harmless little tweak? It goes without saying that I will document the fact that this is a WINE only flag, and that there are unused bits in the GetCharacterPlacement current flags set.
Another alternative I was considering was to add a directional push at the start of the string in order to achieve this without changing the algorithm. The problem is that I am not sure what affect this will have on the reordering, not to mention the fact that I will then need to copy and widen the string inside ExtTextOut, which is an inconvinence to say the least.
Your opinios, please.
Shachar