Bug 129448 - FORMATTING: Line spacing (wrongly) affects automatic first-line indent of Chinese text
Summary: FORMATTING: Line spacing (wrongly) affects automatic first-line indent of Chi...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.8.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Paragraph-Indent
  Show dependency treegraph
 
Reported: 2019-12-17 13:24 UTC by zh_CN User Community Liaison
Modified: 2020-01-16 08:56 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example document with Chinese text, automatic first-line indent, double line spacing (9.90 KB, application/vnd.oasis.opendocument.text)
2019-12-17 13:28 UTC, zh_CN User Community Liaison
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zh_CN User Community Liaison 2019-12-17 13:24:46 UTC
Description:
Forwarding a bug report discovered during discussion in a Chinese LO discussion group.

In mainland China (and I've heard in other places that uses CJK text, too), it's conventional to use "two-character width" indent for the first line of a paragraph.  LO correctly implement this with automatic first-line indent for Chinese text.

However it seems to only work for single spacing, and changing the line spacing to anything else proportional would change the indent width as well.

Steps to Reproduce:
1. Create a new document with Writer;
2. Type or paste a paragraph of Chinese text (at least two lines for better visual cues), leave them in "Default Style", not "Text Body";
3. Set the first-line indent to automatic (either directly change paragraph format or modify the paragraph style, then "Indents & Spacing" tab -> Indent -> check the box in front of "Automatic" under "First line"), also make sure the "Line Spacing" on the same tab is "Single";
4. Notice that the first line is nicely indented by two characters, so far so good;
5. Go back to the Format/Style dialog, same "Indents & Spacing" tab, change "Line Spacing" to "Double".

Actual Results:
The first line is now indented by four character's width

Expected Results:
The first line indent keeps at two character's width


Reproducible: Always


User Profile Reset: Yes



Additional Info:
The effect is proportional to the spacing, as "1.5 Lines" spacing gives three-character-width indent.  The "At least" spacing doesn't seem to affect the indent.

I don't know what the indent convention for western text is, and whether it should depend on line spacing; but for Chinese (and I assume most other CJK) text, it should keep constant regardless of the line spacing.

The original reporter uses LO 6.2.8 on Windows:
版本: 6.2.8.2 (x64)
Build ID: f82ddfca21ebc1e222a662a32b25c0c9d20169ee
CPU 线程: 8; 操作系统: Windows 10.0; UI 渲染: 默认; VCL: win; 
区域语言: zh-CN (zh_CN); UI 语言: zh-CN
Calc: threaded

I can reproduce on both 6.3.4
版本: 6.3.4.2 (x64)
Build ID: 60da17e045e08f1793c57c00ba83cdfce946d0aa
CPU 线程: 2; 操作系统: Windows 10.0; UI 渲染: 默认; VCL: win; 
区域语言: zh-CN (zh_CN); UI 语言: zh-CN
Calc: threaded
... and 6.4.0 beta1
Version: 6.4.0.0.beta1 (x64)
Build ID: 4d7e5b0c40ed843384704eca3ce21981d4e98920
CPU threads: 2; OS: Windows 10.0 Build 18363; UI render: default; VCL: win; 
Locale: zh-CN (zh_CN); UI-Language: en-US
Calc: threaded
Comment 1 zh_CN User Community Liaison 2019-12-17 13:28:38 UTC
Created attachment 156622 [details]
Example document with Chinese text, automatic first-line indent, double line spacing

This should be reproducible with any Chinese text, but for convenience I'm attaching an example document.  Here I changed format by modifying the "Default Style" paragraph style, with automatic first-line indent and double line spacing.

It should show the wrong "four-character width" indent.  Change the line spacing back to single and see the correct "two-character width" indent.
Comment 2 zh_CN User Community Liaison 2019-12-18 10:42:40 UTC
According to bug 64975, Japanese text and Korean text use "one-character width" first line indent.  I assume that they don't want this indent width to be depending on line spacing, either.
Comment 3 Kevin Suo 2020-01-15 00:34:35 UTC
Set platfotm to all as in the Chinese discussion group people already reprodced on Debian.

https://bbs.libreofficechina.org/forum.php?mod=viewthread&tid=2371
Comment 4 Kevin Suo 2020-01-15 00:50:19 UTC
https://cgit.freedesktop.org/libreoffice/core/tree/sw/source/core/text/itrcrsr.cxx

void SwTextMargin::CtorInitTextMargin(...)
Comment 5 Kevin Suo 2020-01-15 14:55:23 UTC
Reproduced in
版本: 6.5.0.0.alpha0+
Build ID: 03fd45dce6afa83fc1fcbcd890edb36affd61981
CPU 线程: 4; 操作系统: Linux 5.0; UI 渲染: 默认; VCL: gtk3; 
区域语言: zh-CN (zh_CN.UTF-8); UI 语言: zh-CN
Calc: threaded

Ubuntu 18.04 X64

Set to NEW.
Comment 6 zh_CN User Community Liaison 2020-01-16 08:56:51 UTC
(In reply to Kevin Suo from comment #4)
> https://cgit.freedesktop.org/libreoffice/core/tree/sw/source/core/text/
> itrcrsr.cxx
> 
> void SwTextMargin::CtorInitTextMargin(...)

Before trying to solve this ourselves, let's first ping the paragraph-indent meta bug and see if any developer there can provide some pointers.