Bug 152142 - RTL Text sometimes falls out of the text box
Summary: RTL Text sometimes falls out of the text box
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.6.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: RTL-CTL Shape-Textbox
  Show dependency treegraph
 
Reported: 2022-11-20 13:08 UTC by Hossein
Modified: 2022-11-28 10:23 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Text box with RTL text (DOCX) (6.29 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-11-20 13:08 UTC, Hossein
Details
Text box with RTL text (ODT) (17.78 KB, application/vnd.oasis.opendocument.text)
2022-11-20 13:11 UTC, Hossein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2022-11-20 13:08:58 UTC
Created attachment 183686 [details]
Text box with RTL text (DOCX)

Description:
RTL Text sometimes falls out of the text box. This example is from page 8 of  attachment 182846 [details].

Steps to Reproduce:
1. Open attachment

Actual Results:
Text falls out of the text box

Expected Results:
Text should fall inside the text box. For a comparison, you can see the output from MS Word. Refer to page 8 of attachment 182846 [details].

Reproducible: Always


User Profile Reset: No


Additional Info:
Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: deb0bb9f2635a8dfec90b42e3727f4224548a8e9
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Hossein 2022-11-20 13:11:03 UTC
Created attachment 183687 [details]
Text box with RTL text (ODT)

In ODT version, the text is still out of the box, but with different amount.
Comment 2 Regina Henschel 2022-11-20 19:53:30 UTC
I can confirm that the text box inside the custom shape ha wrong position

I see that the docx-file has left-to-right text directions in Word.

But I see these problems:
The odt-file should have set text direction to "right-to-left" in page style, but has not. Several default objects have as writing mode "Page", which means they use the writing mode from the closest object in which they are contained and which itself has not writing mode "Page". If the page has writing mode not explicitly set, then (I guess) it takes the writing mode from application environment. For me that is German with "left-to-right". Has the page style for You a text direction "right-to-left"?
The result for me is, that the shape has WritingMode=0" and TextWritingMode="LR_TB" and the paragraph style Frame Content too.

When they do not have the correct text direction, you cannot expect, that the export to docx, produces correct text directions in Word. Of cause that does not mean that the export will produce a usable document if they are correct.

So please try the complete process generating the documents with explicitly setting text directions, so that it is possible to sort out those problems, which come in because of wrong defaults in text directions.

In regard to the position problem, when I change the anchor of the shape from "as character" to "to character", the frame jumps to the correct position.

I set it to "New", because there is surely something wrong.
Comment 3 Stéphane Guillou (stragu) 2022-11-28 10:23:38 UTC
I can already see the text area to the left of the shape in:

Version: 6.3.6.2
Build ID: 2196df99b074d8a661f4036fca8fa0cbfa33a497
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3; 
Locale: en-AU (en_AU.UTF-8); UI-Language: en-US
Calc: threaded

But not as dramatic as the text area completely to the right of the shape in a build from today:

Version: 7.5.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 1fd42472e2b1a2169d56e62ef11aa7ee1f7815e7
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded