Page 1 of 1

Monitoring during loading rtf-file?

Posted: Wed Jun 25, 2014 2:27 pm
by Jim Knopf
I have to work in my application with preset 'use predefined set of styles' in TRichviewEdits Setiings. For special situations I installed 2 additional text styles with a second charset, RUSSIAN_CHARSET e.g. (normal + italic)

One project consits out of many textfiles (rtf).

If I change the projects charset to another, EASTEUROPE_CHARSET e.g., then all textfiles set those special items to DEFAULt_CHARSET, because they don't know EASTEUROPE_CHARSET but only RUSSIAN_CHARSET - logically.

I would like to be able to control the import during LoadRTF that I can convert further RUSSIAN_CHARSET to now EASTEUROPE_CHARSET.

Posted: Wed Jun 25, 2014 3:38 pm
by Sergey Tkachenko
Unfortunately, the function for matching character attributes from RTF to trichview styles is hard-coded.
It is TRVRTFReaderProperties.FindBestStyleNo (RVRTFProps.pas). It returns a similarity value.
If you look at it, you will see that if charsets are different, it prefers matching to DEFAULT_CHARSET.