Issue 126476 - Set Firstline Auto Indent to 2 Chars for Chinese
Summary: Set Firstline Auto Indent to 2 Chars for Chinese
Status: RESOLVED FIXED
Alias: None
Product: Writer
Classification: Application
Component: formatting (show other issues)
Version: 3.4.0
Hardware: All All
: P5 (lowest) Normal (vote)
Target Milestone: 4.1.15
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
: 85257 (view as issue list)
Depends on:
Blocks:
 
Reported: 2015-08-17 16:00 UTC by Mark Hung
Modified: 2023-10-08 15:12 UTC (History)
5 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Proposed patch (886 bytes, patch)
2015-08-17 16:00 UTC, Mark Hung
marklh9: review?
Details | Diff
Comparison of auto indent before and after (158.39 KB, image/png)
2015-08-21 23:26 UTC, Mark Hung
no flags Details
Sample document (9.51 KB, application/vnd.oasis.opendocument.text)
2015-08-21 23:28 UTC, Mark Hung
no flags Details
The ODF markup that causes the Auto-Indent (93.00 KB, image/png)
2015-08-22 01:33 UTC, orcmid
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Mark Hung 2015-08-17 16:00:12 UTC
Currently it always ident for one chacter if paragraph's firstline auto indent is enabled.
The behavior generally suit  Korean and Japanese. But for Chinese, it needs to be doubled.
Comment 1 Mark Hung 2015-08-17 16:00:43 UTC
Created attachment 84886 [details]
Proposed patch
Comment 2 oooforum (fr) 2015-08-19 07:10:49 UTC
Thanks Mark
I set this as PATCH and targeted to 4.1.2

Maybe your patch can solved issue 85257?
Comment 3 Mark Hung 2015-08-20 23:48:11 UTC
Hi,

This patch solved the issue 85257.
Comment 4 Kay 2015-08-21 20:47:53 UTC
I applied this patch to my local source and since I am using en-US everything is the same for me. Before committing it, we need to investigate if this code change is not correct by and ODF 1.2 standard, or what effect it has on the generated XML for the document. Currently, users have the option of manually setting a first line paragraph indent so that might be used instead.

@Mark, can you provide attachments of documents with and without your patch as an illustration?

Thanks.
Comment 5 orcmid 2015-08-21 22:03:13 UTC
(In reply to Kay from comment #4)
> [ ... ] Before committing it, we need to investigate
> if this code change is not correct by and ODF 1.2 standard, or what effect
> it has on the generated XML for the document. [ ... ]
> @Mark, can you provide attachments of documents with and without your patch
> as an illustration?

I checked the ODF 1.2 specification and it does not stipulate any particular behavior although it alludes to "font-size" auto-indentation behavior without specifying any (other than to turn it on or off).

I agree we need to see what happens in the Chinese font case and also how to determine when a double-width adjustment should be made. The with and without would be great. 

The patch looks good, other than it would be very good to see how it affects the presentation of the document and also what the ODF is for the paragraphs where the patched code comes into play.
Comment 6 Mark Hung 2015-08-21 23:26:58 UTC
Created attachment 84889 [details]
Comparison of auto indent before and after
Comment 7 Mark Hung 2015-08-21 23:28:42 UTC
Created attachment 84890 [details]
Sample document
Comment 8 orcmid 2015-08-22 01:33:07 UTC
Created attachment 84891 [details]
The ODF markup that causes the Auto-Indent

Thank you for the side-by-side comparison of the before-and-after with regard to the setting of auto-indent when the character set is Asian and not Japanese or Korean (assuming the various Chinese sets are the only other ones).

The image is of the content.xml file, abbreviated enough just to show the essential information.  

Notice that the user has somehow selected the paragraph style to have auto-indent.  That is not the Standard style default.

This is a preferable technique because it takes into account the font size.  Other methods are more brittle since the user would have to set a specific size although em units, if allowed, would make it easier.

I agree that it is better not to expect so much expertise from the user in order to obtain what is commonly-expected in the user's community.

If there is confidence that the ScriptType::ASIAN set only includes CJK, then the patch is fine.

I think there are two remaining questions:

 1. This will change the behavior with respect to existing Chinese Language documents.  What gives us confidence that this will not be disruptive in the presentation of legacy document?

 2. Because this will impact interoperability in the interchange of ODF documents, we also need to coordinate with LibreOffice.  (I already confirmed that Microsoft Office Word 2013 does not recognize auto-indentation in ODF documents and has no equivalent feature, unless it is language-pack dependent.
Comment 9 Mark Hung 2015-08-22 02:37:28 UTC
To answer Orcmid's question:

1. Change to legacy documents(paragraphs) with auto-indent turned on and CJK set to Chinese is inevitable. However, I suspect that they are exceptional. Children were taught to indent two character space when they start to learn composing with pen and paper. The patch meets general expectation of Chinese users.

Requirements for Chinese Text Layout
http://www.w3.org/TR/clreq/#h-erhuayin
3.4.1 Line Head Indent at the Beginning of Paragraphs
(digested from website:)
 For Chinese publications, line head indent at the beginning of a paragraph usually uses two character-width spaces. Publications like magazines, with multi-column content and less text in each column, might apply a single character-width line head indent at the beginning of paragraph as well.


2. For LibreOffice, I've already submitted the code and has been merged to its master  (currently 5.1) branch.
Comment 10 Kay 2015-08-22 20:58:10 UTC
(In reply to Mark Hung from comment #6)
> Created attachment 84889 [details]
> Comparison of auto indent before and after

Thanks for this.
Comment 11 SVN Robot 2015-08-24 21:04:12 UTC
"kschenk" committed SVN revision 1697501 into trunk:
#i126476# Patch by: Mark Hung
Comment 12 Kay 2016-03-22 23:08:17 UTC
Verification -- see comment #10
Comment 13 Keith N. McKenna 2020-12-09 20:53:31 UTC
*** Issue 85257 has been marked as a duplicate of this issue. ***
Comment 14 Matthias Seidel 2023-10-08 15:12:34 UTC
Cherry-picked for AOO41X with:
https://github.com/apache/openoffice/commit/376de1e92b9cf8f9af0f1e4b64def448bc422b96