Bug 152413 - Text layout involving Narrow No-Break Space (U+202F) is broken
Summary: Text layout involving Narrow No-Break Space (U+202F) is broken
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: All All
: medium normal
Assignee: ⁨خالد حسني⁩
URL:
Whiteboard: target:7.5.0 target:7.4.4
Keywords: bisected, regression
Depends on:
Blocks:
 
Reported: 2022-12-07 14:36 UTC by ⁨خالد حسني⁩
Modified: 2022-12-09 12:58 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Test document (15.28 KB, application/vnd.oasis.opendocument.text)
2022-12-07 14:36 UTC, ⁨خالد حسني⁩
Details
Screenhost showing current rendering (182.71 KB, image/png)
2022-12-07 14:39 UTC, ⁨خالد حسني⁩
Details
Screenhost showing expected rendering (182.63 KB, image/png)
2022-12-07 14:46 UTC, ⁨خالد حسني⁩
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ⁨خالد حسني⁩ 2022-12-07 14:36:28 UTC
Created attachment 184032 [details]
Test document

Text layout involving Narrow No-Break Space (U+202F), e.g. a combining mark placed over it so that it can standalone, is broken and the marks are mispositioned, and I expect kerning or any other text layout feature to suffer from the same issue.
Comment 1 ⁨خالد حسني⁩ 2022-12-07 14:39:09 UTC
Created attachment 184033 [details]
Screenhost showing current rendering

This shot shows the current rendering with the problematic words highlighted.
Comment 2 ⁨خالد حسني⁩ 2022-12-07 14:46:25 UTC
Created attachment 184034 [details]
Screenhost showing expected rendering

This seems to be a regression from bug 67669, reverting the two commits there gives the expected rendering.

This is because highlighted formatting characters create different Writer “portions” so the NNBSP is laid out separate from the rest of the text, which causes broken layout. This affects NBSP and other highlighted characters as well.

I this the commits for bug 67669 should be reverted for now, since this is breaking text layout unnecessarily and we should refrain from adding more such shading until we figure a way to do this without breaking text layout.
Comment 3 ⁨خالد حسني⁩ 2022-12-07 14:52:35 UTC
FWIW. fixing bug 61444 should allow for fixing the root issue here as well, but it does not seem to be an easy fix.
Comment 4 László Németh 2022-12-07 15:25:45 UTC
@Khaled: nice catch! I suggest to revert the fix for tdf#67669 to avoid of the bigger problem, the lost layout.
Comment 5 Commit Notification 2022-12-07 23:31:38 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f6935ce552ed625281104a10695de977a131b477

tdf#152413: Revert "tdf#67669 - Make narrow no-break space visible by drawing

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2022-12-08 10:33:51 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/c1553cf97e54baecb98c805b19e2913d776a33a7

tdf#152413: Revert "tdf#67669 - Make narrow no-break space visible by drawing

It will be available in 7.4.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2022-12-09 12:58:42 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/754b6ef15b8a93f73db4b293ee853668768c91e6

tdf#152413: sw_layoutwriter: Add unittest

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.