Page 1 of 1

Differences in rtf text

Posted: Mon Jan 26, 2009 9:32 am
by grazi
Hi there

We have a strange problem. Text in a rtf box isn't the same size (and maybe not the same font) as when we use static text embedded in the report. The rtf source is 100% correct. If we copy and paste the rtf source to a empty text file, rename it to rtf and open it in word, everything is perfect, size and font are correct.

But when we use the same rtf source in a report, there are some minor differences (see image). Text 1 is static text embedded in the report. Text 2 is a rtf text box. Why do they have different lenghts? The differences aren't big but our customer wants a perfect report so we have to fix it.

Image

Does anyone have an idea?!

Thanks, Grazi

Differences in rtf text

Posted: Mon Jan 26, 2009 1:22 pm
by Ivan
Hello,

RichTextBox uses riched20.dll for text rendering. This dll is drawing the text with the help of its internal methods, not as GDI and GDI +, and not as the MS-Word. Also in Windows can be installed different versions of riched20.dll (from 3.0 in WinXP to 6.0 in Office2007). Therefore, the text in the Textbox and RichTextBox can looks vary.

Solutions:
1. Try to set for textbox a different TextQuality. In some cases the text in the Textbox become similar to the RichTextBox. For different fonts try different TextQuality.
2. In the latest build Textbox has a property AllowHtmlTags, and now you can use the simple formatting of text directly into the TextBox.

Thank you.

Differences in rtf text

Posted: Wed Jan 28, 2009 4:33 am
by grazi
Hello

OK thank you for the infos about rtf. I will try to set the TextQuality.

Thanks