Apache OpenOffice (AOO) Bugzilla – Issue 126476
Set Firstline Auto Indent to 2 Chars for Chinese
Last modified: 2023-10-08 15:12:34 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.
Created attachment 84886 [details] Proposed patch
Thanks Mark I set this as PATCH and targeted to 4.1.2 Maybe your patch can solved issue 85257?
Hi, This patch solved the issue 85257.
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.
(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.
Created attachment 84889 [details] Comparison of auto indent before and after
Created attachment 84890 [details] Sample document
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.
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.
(In reply to Mark Hung from comment #6) > Created attachment 84889 [details] > Comparison of auto indent before and after Thanks for this.
"kschenk" committed SVN revision 1697501 into trunk: #i126476# Patch by: Mark Hung
Verification -- see comment #10
*** Issue 85257 has been marked as a duplicate of this issue. ***
Cherry-picked for AOO41X with: https://github.com/apache/openoffice/commit/376de1e92b9cf8f9af0f1e4b64def448bc422b96