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
Adding unicode.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
See the help file, topic "Unicode in TRichView"
Some additional information: http://www.trichview.com/forums/viewtopic.php?t=70
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
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.
Any suggestions?
-Robnet
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
-Robnet
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: