trichviewedit & Srichviewedit save as rtf

General TRichView support forum. Please post your questions here
Post Reply
376408384
Posts: 20
Joined: Wed Apr 20, 2011 10:20 am

trichviewedit & Srichviewedit save as rtf

Post 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
376408384
Posts: 20
Joined: Wed Apr 20, 2011 10:20 am

Post by 376408384 »

why?
Sergey Tkachenko
Site Admin
Posts: 17524
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Please send me a sample document, both in RVF and RTF formats, to richviewgmailcom.
376408384
Posts: 20
Joined: Wed Apr 20, 2011 10:20 am

Post by 376408384 »

I send to you
Sergey Tkachenko
Site Admin
Posts: 17524
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17524
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
376408384
Posts: 20
Joined: Wed Apr 20, 2011 10:20 am

Post by 376408384 »

:D hey,I am from China, I use the Chinese OS
376408384
Posts: 20
Joined: Wed Apr 20, 2011 10:20 am

Post by 376408384 »

how to add a compiler define RVRTFNOUNICODEFONTNAMES? :D
Sergey Tkachenko
Site Admin
Posts: 17524
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Answered in a private message
Post Reply