Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Why does Uniscribe split text poorly with mixed English + Arabic?

14 views
Skip to first unread message

Chris Shearer Cooper

unread,
Jan 6, 2011, 5:47:48 PM1/6/11
to
I have Unicode text that is mostly English with some Arabic:

Distance between ArabicPlaceName1 and ArabicPlaceName2

where ArabicPlaceName1 and ArabicPlaceName2 are place names written in
Arabic; the words "Distance", "between", and "and" are all in English.

I am going to be drawing this myself, and it will be created for an
Arabic audience so the actual presentation will look more like this:

ArabicPlaceName2 and ArabicPlaceName1 Distance between

But I want to use Uniscribe to help me break it into the RTL (right-to-
left) and LTR (left-to-right) pieces, so I call ScriptItemize with a
SCRIPT_CONTROL object that is all zeroes, and a SCRIPT_STATE that is
all zeroes except uBidiLevel is 1.

The problem is that Uniscribe isn't assigning the spaces very
cleverly, or maybe I just don't understand what it's doing.
ScriptItemize gives me back 6 items, and based on the iCharPos in the
SCRIPT_ITEM I can see that the items are split like this:

"Distance between"
" ArabicPlaceName1 "
"and"
" ArabicPlaceName2"

I had thought I could just draw these, left to right, in reverse order
(starting with item [nItem-1]) but if I do that, I get

" ArabicPlaceName2and ArabicPlaceName1 Distance between"

in other words, the space that should be between ArabicPlaceName2 and
"and" instead ends up at the start of ArabicPlaceName2.

Am I misusing Uniscribe? Or doing something wrong so it isn't putting
the spaces in the right places?

Thanks,
Chris

0 new messages