Page 1 of 1

Numbered lists, wrong font after load / save

Posted: Mon Nov 20, 2023 9:12 am
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 27460 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 27460 times
André

Re: Numbered lists, wrong font after load / save

Posted: Wed Nov 22, 2023 12:26 pm
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.

Re: Numbered lists, wrong font after load / save

Posted: Thu Nov 23, 2023 6:54 am
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é

Re: Numbered lists, wrong font after load / save

Posted: Thu Nov 23, 2023 7:08 am
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.

Re: Numbered lists, wrong font after load / save

Posted: Tue Apr 02, 2024 7:12 am
by a.weber
Hello Sergey,
Have you also worked on this point in the current version?

Re: Numbered lists, wrong font after load / save

Posted: Tue Apr 02, 2024 10:38 am
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.