Numbered lists, wrong font after load / save

General TRichView support forum. Please post your questions here
Post Reply
a.weber
Posts: 63
Joined: Wed Mar 02, 2022 7:02 am

Numbered lists, wrong font after load / save

Post by a.weber »

Hello,
in some of our MSWord created files (docx, rtf) there is a custom Textstyle "Standard-Arial" applied to all texts the default "Standard" ist kept with word defaults. (this happens also if you assign in word just any font or size without useing a template)

If we load such a document with TRichView or ScaleRichView and save these documents as RTF or DOCX - the Format / Style of the numbers is reset to "Standard" instead of "Standard-Arial".
In the original Word document the StyleTemplates for these numbered lists don't have a fontname and so on, but after load / save with TRichView they get assigned the first style / font of the document.
In Word these NumberLists use / inherit the format of the paragraph just in time of rendering.
I think the logic durring loading these styles from docx / rtf is wrong, that they substitute the not assigned font with the document default / first font?

The list uses the "Standard-Arial" Formattemplate - with Arial 12 as its default. So the numbers are Arial 12 and Text after.
SimpleList_MSWord.png
SimpleList_MSWord.png (20.62 KiB) Viewed 43011 times
After load save the numbers are rendered with "Calibri" ("Standard") - because the template of the list was changed from no font - to first font / format.
SimpleList_ScaleRichView.png
SimpleList_ScaleRichView.png (20.67 KiB) Viewed 43011 times
André
Attachments
SimpleList_MSWord.docx
(13.84 KiB) Downloaded 2410 times
SimpleList_ScaleRichView.docx
(6.68 KiB) Downloaded 2356 times
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Numbered lists, wrong font after load / save

Post by Sergey Tkachenko »

I'll check what I can do to load these files as close to the original as possible.
But currently TRichView does not have an option for not defining font for a list marker.
a.weber
Posts: 63
Joined: Wed Mar 02, 2022 7:02 am

Re: Numbered lists, wrong font after load / save

Post by a.weber »

Hi,

my first idea was - to clone the list style and set the same font / size / color - as the following paragraph, but this seems a very complex tasks - because if the same list style is used with different fonts/size/color - I need extra clones and I need to find out where a new list starts so that every instance of a numbered list may get it's own style with the correct font / size / color at each level.
First I think we should preserve the info that the font or some properties are not defined in the loaded document and were substituted with some "default" to ignore these list styles / levels durring clone if f.e. the font was assigned in the loaded document.

André
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Numbered lists, wrong font after load / save

Post by Sergey Tkachenko »

Normally, when reading RTF, TRichView creates lists basing on RTF's table of lists. Then it adjusts list property according to the first occurrence of a list marker. As far as I remember, such an adjustment includes modifying indents. I'll see, maybe I can do the same with fonts.
a.weber
Posts: 63
Joined: Wed Mar 02, 2022 7:02 am

Re: Numbered lists, wrong font after load / save

Post by a.weber »

Hello Sergey,
Have you also worked on this point in the current version?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Numbered lists, wrong font after load / save

Post by Sergey Tkachenko »

Actually, TRichView already does adjustment of some font properties for the first list marker. But it does not do it for a font name.
It's more complicated, because fonts name of bullets should not be adjusted. I need more time. Not in the next update, sorry.
Post Reply