Page 1 of 1

DocX load field gets wrong Font/Style

Posted: Mon Jan 08, 2024 12:48 pm
by a.weber
Hello,
some of our documents with fields gets a wrong font and style after substition. I found that these fields have repeated format commands inside the docx XML - Word seems to ignore them and use only the first? I have modifed RV docx reader the same way - it seems to work - can you check this please?

The expression VERT_ORT is formated as "Arial 10"
field_original.png
field_original.png (49.84 KiB) Viewed 59628 times


After a load / save with RichView its a "Times New Roman" 12
field_replaced.png
field_replaced.png (47.92 KiB) Viewed 59628 times
if I investigate the docx XML I can see that there are some style informations with Times New Roman assigned to this field - but in Word I never see this formating - also if I have select the whole text of this document and assign a new font - the result stays the same this single entry "vert_ort" turns into
"Times New Roman".

(As private message I sent you my modified RVDocXReader.pas - with my WorkAround to read only the first CharProps entry.)

With best regards
André

Re: DocX load field gets wrong Font/Style

Posted: Tue Jan 09, 2024 1:03 pm
by Sergey Tkachenko
Thank you!
I accepted your code modification.
It will be included in the next update.

Re: DocX load field gets wrong Font/Style

Posted: Sun Jan 28, 2024 12:18 pm
by Sergey Tkachenko
Foxed in TRichView 22.2

Re: DocX load field gets wrong Font/Style

Posted: Tue Apr 02, 2024 7:03 am
by a.weber
Ok - tested - works - one point less on the list.