Page 1 of 1

Adding unicode.

Posted: Sat Mar 18, 2006 2:48 pm
by robnet
I've search through the help fille, the demo files, and this forum but have not found explicit instructions for adding unicode to TRichview.

This has been set:
TRVStyle.TextStyles[].Unicode = TRUE;

For example, if I want to add a square root symbol, unicode is 221A (or U-221A or 0000 221A).

How is this done using AddNL? It must be passed as a string, but no combination of the following appears to work: '221A', '0000 221A' etc.

Suggestions?

-Robnet

Posted: Sun Mar 19, 2006 3:10 pm
by Sergey Tkachenko
See the help file, topic "Unicode in TRichView"
Some additional information: http://www.trichview.com/forums/viewtopic.php?t=70

Code: Select all

ws: WideString;

ws := WideChar($221A);

rv.Clear;
rv.Style.TextStyles[0].Unicode := True;
rv.AddNLWTag(ws, 0, 0, 0);
rv.Format;

Overline

Posted: Thu Mar 30, 2006 1:16 am
by robnet
Thanks Sergey, that worked perfectly, and we were able to have it stream correctly as RTF back into TRichview.

However, the overline style does not seem to stream back correctly. I've tested several properties in RTFReadProperties, but none seem to work. I simply want to add overline to text, save RTFToStream, and then LoadRTFFromStream into a different TRichview.

Here is a code example -- I'm trying to make a squareroot symbol with text.

Code: Select all

  ws := WideChar($221A);  //square root symbol
  RichView1.AddNLWTag( ws, 18,0,0);  //style 18 is unicode
  RichView1.AddNL('42',19,-1);  //style 19 is overline
  RichView1.Format; //looks fine here

    RichView1.SaveRTFToStream(  ms, False );
    ms.Position := 0;
    RichView2.LoadRTFFromStream( ms );
    RichView2.Format; //the squareroot symbol is back, but no overline

Any suggestions?

-Robnet

Posted: Thu Mar 30, 2006 7:27 am
by Sergey Tkachenko
RTF format does not support overlines.