Home > Blockchain >  Need help to setup RichEdit
Need help to setup RichEdit

Time:10-30

I'm trying to set the following text in RichEdit (v2.0 I guess, as I use "Riched20.dll" library):

{\rtf1Привет!\par{ \i This } is super {\b text}.\par}

The first problem is wrong symbols instead of non-latin text Привет, the second problem is bold text section {\\b text}, which is rendered as non bold. Here is the screenshot:

RTF example

Visual Studio set up to "Use Unicode Character Set" (the app I'm working on is already setuped this way, and I'm still quiet bad in how Win encodings work). I use ordinar (e.g. not wide char) std::string, as wide char classes don't work for my code - that was my previous enter image description here

List of main control words used in the rtfstring above (according the Rich Text Format (RTF) Version 1.5 Specification):

  • \rtf1
    The RTF document Specification version is 1.

  • \deffN
    The \deff control word specified the default font number.

  • \fonttbl
    The \fonttbl control word introduces the font table group.

  • \lang1033
    Applies a language to a character. N is a number corresponding to a language.

In the project settings you can define Character Set as Use Unicode character, Use Multi-Byte Character or Not Set, does not matter for this case.

  • Related