I need this CRichEditCtrl to be able to display whatever I throw at it,
regardless of the language. If I send it English it's perfectly happy, but
if I send it Hebrew - first calling ModifyStyleEx(WS_EX_LTRREADING,
WS_EX_RTLREADING) and then sending it what looks like reasonable RTF to me
...
{\rtf1\ansi\ansicpg1255\deflang1037\rtldoc\lang1037\rtlch ,
\'E8\'F7\'F1\'F1}
while it displays Hebrew characters, it absolutely refuses to switch to
right-to-left mode.
I've seen various postings that seem to hint that this is a known bug with
CRichEditCtrl - can anyone verify this?
Thanks!
Chris
The piece of RTF you posted is "reasonable RTF", but not "reasonable Hebrew
RTF" :-)
The RTF specs have special keywords to handle RTL features, just setting the
flags of the control have no effect.
Try this (added \rtlpar and \qr):
{\rtf1\ansi\ansicpg1255\deflang1037\rtldoc\lang1037\rtlpar\qr\rtlch
\'E8\'F7\'F1\'F1}
You can try the following:
- take the RTF spec and spend a lot of time understanding what is going on
there (and if you want to handle ANY language, is not going to be easy)
- forget the manually generated rtf and stuff the text in the control using
Windows messages (way easyer, but with a bit less control)
--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email