Page 1 of 1

Inserting Zero Width Joiner control character ZWJ (#$200D)

Posted: Wed Oct 15, 2008 7:44 pm
by rvuser1719
Dear Sergey,

the Zero Width Joiner (ZWJ = #$200D = #8205) does not work.

As example,

if I enter this sequence

क + ् + #8205

then the result must be

क्‍

But it looks like the control character gets lost in the editor so the result is just this:

क्

What I do in the program is:

procedure InsertZWJ(View: TRichViewEdit);
var
wcZWJ: WideString;
begin
wcZWJ := 'क' + '्' + #8205;
View.InsertTextW(wcZWJ, False);
end;


Would you like to suggest a solution for this problem?

Thank you.
Wadim

Posted: Thu Oct 16, 2008 10:17 am
by Sergey Tkachenko
Will be fixed in the next update.
But should not it be inserted BETWEEN the characters to join?

Posted: Thu Oct 16, 2008 10:35 am
by rvuser1719
Sergey Tkachenko wrote:Will be fixed in the next update.
Thank you. When do you plan to release the next update?
Sergey Tkachenko wrote:But should not it be inserted BETWEEN the characters to join?
You are right, it usually should be inserted between characters to prevent the building complex conjuncts like this one

क् + ष = क्ष

But using ZWJ we get another result

क् + ZWJ + ष = क्‍ष

It is very important for complex Unicode scripts like Indic Devanagari ...

There are also other special (control) characters which are very important too, as example ZWNJ (#8204, Zero Width Non-Joiner)

क् + ZWNJ + ष = क्‌ष

Wadim

Posted: Thu Oct 16, 2008 10:51 am
by Sergey Tkachenko
ZWJ was mistakenly removed from text before drawing it. Fixed version will be available for registered users later this week.

Posted: Thu Oct 16, 2008 11:05 am
by rvuser1719
Sergey Tkachenko wrote:Fixed version will be available for registered users later this week.
Thanks a lot!

Wadim

Posted: Tue Oct 21, 2008 8:19 am
by Sergey Tkachenko
Uploaded.

Posted: Tue Oct 21, 2008 7:19 pm
by rvuser1719
Sergey Tkachenko wrote:Uploaded.
This is just to confirm that it is perfectly working now. THANK YOU!
Wadim

Posted: Fri Jan 06, 2012 8:42 pm
by mohsen24000
dose "no-width non break character" support in trichview?
such as MSWord in RTL language as persian, arabic, etc.

Posted: Fri Jan 06, 2012 9:40 pm
by mohsen24000
when use:
rve.add(str+widechar($AD)+str);
or
rve.add(str+widechar($200D)+str);
and then save it to RTF file. in MSWord it's worked and shown, but dose'nt show in richviewedit!
please help me for this problem.
my richedit's version is 12

Posted: Sun Jan 08, 2012 6:06 pm
by Sergey Tkachenko
There is no special support for this character, but it should work automatically.
What's you version of Delphi?

Posted: Sun Jan 08, 2012 6:25 pm
by mohsen24000
thanks dear.
my delphi version is 2010.

Posted: Sun Jan 08, 2012 6:59 pm
by Sergey Tkachenko
I made the following test: I copied the second post of rvuser1719 (the post containing examples using #$200D) and pasted it as a plain Unicode text in the ActionTest demo (a demo available on the web site, compiled using Delphi XE2 and the latest TRichView version).

The results look like expected: like they are displayed in a browser. I tried Arial and Times New Roman fonts.

If you have problems, please create a simple demo project and send it to me (richviewgmailcom).

Posted: Wed Jan 18, 2012 5:57 am
by mohsen24000
hi dear sergey.
i resolve it!
before loading rtf file, i replace \zwnj that deleted in richview with \-
and after loading in richview replace it with #$200F and problem fix...

Code: Select all

sRTF:=Tstringlist.Create;
sRTF.LoadFromFile('d:\sample\doc1.rtf');
//sRTF.Text:=Replace(sRTF.Text,'\zwnj',' ');
sRTF.Text:=Replace(sRTF.Text,'\zwnj','\-');
sRTF.SaveToFile('d:\sample\doc1_tmp.rtf');

Code: Select all

rv.BeginUpdate;
RVSetLinearCaretPos(rv,0);
ft := #173; rt:= #$200F;
while rv.SearchText(ft,[rvseoDown]) do
rv.InsertText(rt,False);
RVSetLinearCaretPos(rv,0);
rv.EndUpdate;

Posted: Wed Jan 18, 2012 7:56 am
by Sergey Tkachenko
Are you sure that you need zero width JOINER? As I understand from your samples, you need to prevent text from joining. So you should use zero width NON-JOINER ($200C)