Bug 156333 - Writer ignores <tint> tag for textboxes when loading DOCX created in MS office
Summary: Writer ignores <tint> tag for textboxes when loading DOCX created in MS office
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.4.2 release
Hardware: All All
: medium normal
Assignee: Vladislav Tarakanov
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: OOXML-WordArt
  Show dependency treegraph
 
Reported: 2023-07-17 14:00 UTC by Vladislav Tarakanov
Modified: 2023-07-21 06:20 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
MS O and LO compare (79.23 KB, image/png)
2023-07-17 14:02 UTC, Vladislav Tarakanov
Details
Using file (14.08 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-07-17 14:02 UTC, Vladislav Tarakanov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladislav Tarakanov 2023-07-17 14:00:07 UTC
Description:
There was a need to open a document created in MS office 2013 that contains WordArt. After opening the document, the WordArt letters were green instead of the expected white.

Checked the contents of document.xml and noticed that the WordArt color is set to green, which is converted to white using the <w14:tint w14:val="1000" /> tag. After removing this tag, the colors of the letters in MS O and LO became identical.

Steps to Reproduce:
1. Create a new document in MS O 2013
2. Add WordArt with white letters and blue border
3. Save file
4. Open saved file in LO Writer

Actual Results:
WordArt has green letters

Expected Results:
WordArt has white letters and blue border


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 12; OS: Linux 6.1; UI render: default; VCL: kf5 (cairo+xcb)
Locale: ru-RU (ru_RU.UTF-8); UI: ru-RU
Calc: threaded
Comment 1 Vladislav Tarakanov 2023-07-17 14:02:12 UTC
Created attachment 188411 [details]
MS O and LO compare
Comment 2 Vladislav Tarakanov 2023-07-17 14:02:53 UTC
Created attachment 188412 [details]
Using file
Comment 3 Vladislav Tarakanov 2023-07-17 14:03:40 UTC
Together with @Amin, we tried to find the place in the code where the problem occurs and fix it. We checked the code in OOX, but they saw the processing of the tint tag for charts. The color processing associated with textboxes was also not found here. We looked in SFX2, but did not find the exact place where the components are created to display the model. Now we are trying to find something suitable in SW.
Comment 4 raal 2023-07-17 14:15:50 UTC
Hello, there is developers mailling list https://lists.freedesktop.org/mailman/listinfo/libreoffice - you can ask there.
Comment 5 Regina Henschel 2023-07-17 15:55:52 UTC
The issue is not that the 'tint' effect is not interpreted, but LibreOffice is not able to render text effects. LibreOffice can only render those effects, which are listed on the 'Font effects' tab of the character dialog. Especially, LibreOffice is not able to distinguish between fill and outline of characters.

Here it means, that the w14:glow, w14:textOutline and w14:textFill elements are ignored and only w:color="70AD47A" is used. That is the Green which is used for the characters.

I have only found bug 65260 about 'bevel' and 'reflection', but there might be other bug reports about missing text effects.

There is a similar bug 139901 for PPTX. But the import of characters in Writer is different from import in Impress.
Comment 6 Vladislav Tarakanov 2023-07-17 16:37:40 UTC
Fontwork's functionality seems to be enough to fix the current problem with color if tint support is implemented, as it supports different colors for border and text fill. But there may be a problem with text stretching to incorrect sizes after import.
Comment 7 Regina Henschel 2023-07-17 17:12:52 UTC
Please do not confuse text effects in Word 365 with Fontwork in LibreOffice.

The text effects in Word 365 are rendering effects for characters. Fontwork in LibreOffice is an effect of custom-shapes. Only abc-Transform in Word 365 is comparable to Fontwork in LibreOffice and we convert one to the other on import and export. Converting works reasonable in current LibreOffice, but some things are principle incompatible or do not exist in LibreOffice. Especially word-wrap inside the text-box is a problem and situations where the text-box in Word 365 has its own fill and stroke.

You would need to detect on import, whether the content of a text-box is so simple, that it can be expressed by a LibreOffice Fontwork. "Simple" means: All characters have the same style, a line does not start with blank, all paragraphs have the same alignment and indent, and there are no other objects contained in the text box.

Stretching is no problem, you can use a Fontwork-shape with one line instead of two lines.
Comment 8 Amin Irgaliev 2023-07-17 17:34:12 UTC
Is the current problem with font effects fundamentally unsolvable or is it possible to implement them for LO? And if possible, can we, as beginning developers, implement this?
Comment 9 Regina Henschel 2023-07-17 20:11:32 UTC
It is not "fundamentally unsolvable" but I think it requires a lot to implement a new kind of rendering for characters. I mostly work on shapes not on text, so please use the links in section "Connect to our communication channels" on https://wiki.documentfoundation.org/Development/GetInvolved to come in contact with Writer experts. The Document Foundation has mentors for beginning developers and they can discuss it with you.
Comment 10 Roman Kuznetsov 2023-07-21 06:20:59 UTC
Set to ASSIGNED because Vladislav already took this one