Bug 136851 - No-break space not working with Asian font text or mixed Western and Asian
Summary: No-break space not working with Asian font text or mixed Western and Asian
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CJK Formatting-Mark
  Show dependency treegraph
 
Reported: 2020-09-17 15:14 UTC by Thomas Lendo
Modified: 2021-04-01 16:16 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Lendo 2020-09-17 15:14:43 UTC
No-brake space not working with Asian font text or mixed Western and Asian font text.

Steps to reproduce:

1. Create a new Writer document.
2. Copy the following text and paste it in the document: 范围从20至100mm成层
3. Shrink the document width with the horizontal ruler to any position within '100mm'

Result: No line break in '100mm'.

3. Insert a no-break space between '100' and 'mm' with Ctrl+Space or the Special Characters dialog (U+A0)
4. Insert a no-break space between the last two Chinese characters '成层'.

Result: The line will break between '100' and 'mm' or between the 2 'm' or between '成层' when you reposition the ruler.

Expected result: No line break in a Western string with a no-break space or between any characters that are linked with a no-break space.


Version: 7.1.0.0.alpha0+ (x64)
Build ID: abcc4eb907661e07ad850ccce7eb06f129da4286
CPU threads: 12; OS: Windows 10.0 Build 18363; UI render: Skia/Vulkan; VCL: win
Locale: de-AT (de_AT); UI: en-US
Comment 1 Dieter 2021-04-01 08:51:25 UTC
I confirm it with

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: f96004096268f5e71120678e32fc8c74055819aa
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL
Comment 2 Ming Hua 2021-04-01 16:16:59 UTC
Not exactly surprising, as the default line-breaking rule for (modern) Chinese is "anywhere but some special place before/after punctuation marks", as we don't use spaces to separate "words" at all.  And new exceptions to this rule had to be introduced when Latin-and-Chinese mixed text layout was considered.

It's probably not hard to fix though, one just needs to treat non-breaking spaces not as whitespace character when considering line-break positions.

It would be interesting to know if the same problem exists for Korean texts, as they use spaces to separate words.  Japanese doesn't (just like Chinese) and presumably is also affected.