Bug 155772 - Japanese, vertical CTL text: some pasted text displayed incorrectly
Summary: Japanese, vertical CTL text: some pasted text displayed incorrectly
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All Linux (All)
: medium normal
Assignee: Jonathan Clark
URL:
Whiteboard: target:25.2.0
Keywords:
Depends on:
Blocks: CJK Vertical-Text
  Show dependency treegraph
 
Reported: 2023-06-11 03:06 UTC by Rob
Modified: 2024-06-21 16:48 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Vertical RTL LibreOffice Writer template (14.95 KB, application/vnd.oasis.opendocument.text-template)
2023-06-11 03:06 UTC, Rob
Details
wagahai_neko.txt (25.43 KB, text/plain)
2023-06-11 03:08 UTC, Rob
Details
text_copied.odt (81.31 KB, application/vnd.oasis.opendocument.text)
2023-06-11 03:08 UTC, Rob
Details
screenshot_after_open.png (423.25 KB, image/png)
2023-06-11 03:09 UTC, Rob
Details
screenshot_after_copy.png (427.80 KB, image/png)
2023-06-11 03:09 UTC, Rob
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rob 2023-06-11 03:06:49 UTC
Created attachment 187830 [details]
Vertical RTL LibreOffice Writer template

When arbitrary Japanese text is pasted into a LibreOffice Writer document configured for vertical right-to-left text, an intermittent problem occurs where text is not displayed correctly. Specifically, two columns of text appear to overlap. I have noticed a possible relationship with columns starting with the "「" character.

I am not able to provide the data where I originally observed this bug, but I have been able to reproduce the bug using text from a public-domain Japanese text (source here: https://www.aozora.gr.jp/cards/000148/card790.html ).

### Steps to reproduce

1. Create a new LibreOffice document using the template attached (genkoyoshi_bug_template.ott).
2. Copy the contents of the attached wagahai_neko.txt file.
3. Paste the contents of the file into the LibreOffice document.
4. Scroll to page 7. One of the columns appears to contain two columns of text, which are overlapping each other (as in screenshot_after_copy.png)

Additionally, after saving the document file (attached as text_copied.odt) and reopening it, page 7 still contains a column with two overlapping columns of text, but in a slightly different place (as in screenshot_after_open.png).

### Environment

OS: Ubuntu 22.04.2 LTS
LibreOffice 7.5.4.2 (installed via snap 'candidate' branch)
Comment 1 Rob 2023-06-11 03:08:06 UTC
Created attachment 187831 [details]
wagahai_neko.txt
Comment 2 Rob 2023-06-11 03:08:34 UTC
Created attachment 187832 [details]
text_copied.odt
Comment 3 Rob 2023-06-11 03:09:03 UTC
Created attachment 187833 [details]
screenshot_after_open.png
Comment 4 Rob 2023-06-11 03:09:23 UTC
Created attachment 187834 [details]
screenshot_after_copy.png
Comment 5 Dieter 2023-07-08 07:50:51 UTC
Rob, I'm not sure how I should copy .txt -file (if I open it in Microsoft Editor it looks very ugly). So I've just opened text_copied.odt and couldn't confirm the problem. Everything looks fine. Perhaps problem is only related to Linux?

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 069c7dc4e9706b40ca12d83d83f90f41cec948f8
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded
Comment 6 Rob 2023-07-11 01:01:18 UTC
Thanks for your time, Dieter.

After seeing your comment, I tried in Windows as well, and was also unable to replicate this issue in a Windows 10 VM.

Under Linux, I noticed that sometimes, several pastes of the same text are necessary to observe the issue. I tried this also in Windows, and did not observe the issue.

I have tested this under both Wayland and X11, and observed this issue in both cases:

Wayland:

Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: en-GB (ja_JP.utf8); UI: en-US
Gentoo official package
Calc: threaded

X11:

Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 3; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: ja-JP (ja_JP.utf8); UI: ja-JP
Gentoo official package
Calc: threaded

I also observed this issue in a KDE VM:

Version: 7.5.2.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 2; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 4:7.5.2-0ubuntu1
Calc: threaded

I'm happy to provide any other information.
Comment 7 Shinji Enoki 2023-07-21 01:42:52 UTC
reproduced in

Debian 11
Version: 7.5.5.2 (X86_64) / LibreOffice Community
Build ID: ca8fe7424262805f223b9a2334bc7181abbcbf5e
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: ja-JP (ja_JP.UTF-8); UI: ja-JP
Calc: threaded
Comment 8 Shinji Enoki 2023-07-21 02:01:44 UTC
When I turned it on by clicking the menu [View]-[Format Marks], the overlap disappeared. The overlap does not appear even with Format Marks turned off.
But when I close the file and reopen it, it's overlapping again.
Comment 9 Jonathan Clark 2024-06-21 16:48:30 UTC
After applying the fix for bug 107209, I can no longer reproduce this issue. It's likely this was a duplicate, but the steps to reproduce are very different and don't fit my current understanding of the issue. I think it would be best to separately verify this bug, so I am instead marking it fixed.


Jonathan Clark committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c7f1e41ca672f6bb1055b92012fff0d92a5ff805

tdf#107209 Writer correct vertical text break after fly portions

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.