Page 1 of 1

trichviewedit & Srichviewedit save as rtf

Posted: Tue May 03, 2011 3:05 am
by 376408384
when I save as rtf and open the rtf with Microsoft's wordpad
, in the front of document will appear the Fonts name


Just some Fonts will appear it like Chinese Fonts

but some Fonts like Arial will not appear in the head of document

Posted: Tue May 03, 2011 2:49 pm
by 376408384
why?

Posted: Wed May 04, 2011 6:34 am
by Sergey Tkachenko
Please send me a sample document, both in RVF and RTF formats, to richviewgmailcom.

Posted: Thu May 05, 2011 9:21 am
by 376408384
I send to you

Posted: Thu May 05, 2011 1:58 pm
by Sergey Tkachenko
I am afraid it cannot be fixed.

The problem with Wordpad/RichEdit: it does not expect Unicode characters in the RTF font table, so it just inserts them in a normal text.

A similar problem was for Unicode characters in document properties (like author, title, comments). I added a workaround using \upr\ud keywords.
I tried to make the same workaround in RTF font table. Wordpad reads it correctly (ignores Unicode but takes ANSI characters from the font names). But now the problem is in MS Word! It does not expect \upr\ud keywords in RTF font table...

By the way, I tried to resave your test_rtf1.rtf in MS Word, and it cannot save this RTF correctly! It saves '??' as a font name (at least, in non-Chinese version of Windows).

So I leave TRichView code unchanged, because I cannot see a solution.

Posted: Thu May 05, 2011 2:09 pm
by Sergey Tkachenko
Well, ok.
I'll add a compiler define RVRTFNOUNICODEFONTNAMES. You can activate it in RV_Defs.inc or in the options of your project.
If activated, TRichView will convert font names from Unicode before saving them to RTF. This conversion may lose information (for example, on my computer, this font name is converted to '??'), but it makes Wordpad/RichEdit happy.

Posted: Thu May 05, 2011 3:00 pm
by 376408384
:D hey,I am from China, I use the Chinese OS

Posted: Fri May 06, 2011 9:04 am
by 376408384
how to add a compiler define RVRTFNOUNICODEFONTNAMES? :D

Posted: Fri May 06, 2011 3:30 pm
by Sergey Tkachenko
Answered in a private message