Bug 116577 - Provide new Space opportunity algorithm for CJK text layout.
Summary: Provide new Space opportunity algorithm for CJK text layout.
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks: CJK
  Show dependency treegraph
 
Reported: 2018-03-23 02:28 UTC by Volga
Modified: 2018-05-29 00:03 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volga 2018-03-23 02:28:07 UTC
Description:
Seen from attachment 137942 [details] and attachment 137944 [details] I found the spacing between CJK and western text looks narrow than text inserted space between CJK and western text. I.e. our spacing algorithm between CJK and western text not looks consistent with wenstern text font, so I suggest a new algorithm for finding Space insertion opportunities between CJK and western text. This algorithm works as follows:
1. Get width of space (U+0020) from western text font
2. Finding Space insertion opportunities
3. Insert it as a gap between CJK and western text, but not treat as individual character.


Steps to Reproduce:
-

Actual Results:  
-

Expected Results:
-


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (Android 5.1.1; Mobile; rv:59.0) Gecko/59.0 Firefox/59.0
Comment 1 Volga 2018-03-28 04:55:15 UTC
This algorithm should having an exception for space between CJK characters, where the space should keep 1 en.
Comment 2 Mark Hung 2018-04-01 14:09:50 UTC
(In reply to Volga from comment #0)
> Description:
> Seen from attachment 137942 [details] and attachment 137944 [details] I
> found the spacing between CJK and western text looks narrow than text
> inserted space between CJK and western text. I.e. our spacing algorithm

I don't understand your original description. Is there any mistake in the above text?

"spacing between CJK and western text looks narrow than text inserted space between CJK and western text" 

Which spacing do you compare? 
Is it possible for you to highlight with picture?

There is a feature called "Apply spacing between Asian and non-Asian text" in "Asian Typography" tab of paragraph style. If you enable that, space will be inserted between Asian and other scripts.
Comment 3 Volga 2018-04-03 06:52:52 UTC
OK, let me explain. This algorithm is an improvement for "Apply spacing between Asian and non-Asian text" functionality, this algotithm will make the width of this spacing match the width of space in a western text font, rather than fixed width.
Comment 4 Mark Hung 2018-04-05 09:31:30 UTC
(In reply to Volga from comment #3)
> OK, let me explain. This algorithm is an improvement for "Apply spacing
> between Asian and non-Asian text" functionality, this algotithm will make
> the width of this spacing match the width of space in a western text font,
> rather than fixed width.

Is there any other software padding this way, or any source suggesting that?

There is no standard for the width of kerning inserted between CJK and other scripts, but CLREQ said it is up to a quarter of the width of a Han character:

https://www.w3.org/TR/clreq/
3.2.4 Handling Western Text in Chinese Text Using Proportional Western Fonts
Tracking or spacing between a Han character and a Western letter or numeral is up to a quarter of the width of a Han character.
Comment 5 Volga 2018-04-06 10:55:39 UTC
Oh, I understand, thanks. And I decided to close.
Comment 6 Volga 2018-05-29 00:03:57 UTC
Now I have an idea that is it possible to make use of four-per-em space (U+2005)? If so I will reopen this bug.