Bug 162358 - Font fallback for Fat7a diacritic fails in track changes, succeeds otherwise
Summary: Font fallback for Fat7a diacritic fails in track changes, succeeds otherwise
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Jonathan Clark
URL:
Whiteboard: target:25.2.0 target:24.8.1
Keywords:
Depends on:
Blocks: Track-Changes RTL CTL
  Show dependency treegraph
 
Reported: 2024-08-05 14:20 UTC by Eyal Rozenberg
Modified: 2024-08-20 12:05 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of bug manifesting (32.03 KB, image/png)
2024-08-05 14:20 UTC, Eyal Rozenberg
Details
Document used to generate the screenshot (14.27 KB, application/vnd.oasis.opendocument.text)
2024-08-05 14:23 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2024-08-05 14:20:35 UTC
Created attachment 195721 [details]
Screenshot of bug manifesting

This is a followup/regression bug for bug 124116:


With v24.8 and earlier, if we opened attachment 150012 [details] and looked at the last triplet of lines, with the Arabic text, we saw the manifestation of the bug in which the harakaat (diacritics) were separated from the word due to being tracked changes. With 25.02, we no longer see the bug on the second line of this triplet, while on the third line we see a tracked-change box instead of a tracked-change Fatha over the final ba letter. 

This may have something to do with font fallback, as the RTL-CTL font family is David CLM, which doesn't have glyphs for Arabic harakaat. Yet - why didn't we see this before?

Anyway, if one accepts the changes, problems go away.
Comment 1 Eyal Rozenberg 2024-08-05 14:23:46 UTC
Created attachment 195722 [details]
Document used to generate the screenshot

This is a modification of attachment 150012 [details]; it exhibits the bug and was used to create the screenshot in attachment 195721 [details].
Comment 2 Eyal Rozenberg 2024-08-05 14:23:56 UTC
Build info:

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 01e6e4303e5a9966f102e0357fe0354a2f74a1c4
CPU threads: 4; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US
Comment 3 Jonathan Clark 2024-08-05 14:59:54 UTC
Can reproduce per discussion in 124116. Confirming.

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: cb7c70cd19237268b748d3e35f8bbed2150042ea
CPU threads: 32; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 4 Commit Notification 2024-08-08 03:43:19 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "master":

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

tdf#162358 Fix missing fallback run inside grapheme cluster

It will be available in 25.2.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 5 Eyal Rozenberg 2024-08-08 07:25:40 UTC
(In reply to Commit Notification from comment #4)

I couldn't how "populating fallback runs" is done by remapping the glyph position which is what happens in the patch, but if it's fixed then it's fixed... I'll try the next nightly I guess.
Comment 6 Jonathan Clark 2024-08-08 13:06:42 UTC
(In reply to Eyal Rozenberg from comment #5)
> (In reply to Commit Notification from comment #4)
> 
> I couldn't how "populating fallback runs" is done by remapping the glyph
> position which is what happens in the patch, but if it's fixed then it's
> fixed... I'll try the next nightly I guess.

Hi Eyal,

The missing context in the diff is that nCharPos is the index of the first codepoint that contributed to a grapheme cluster. For most purposes, this is the only sensible value, but for rendering text runs that break grapheme clusters we need more precision. This change made the implementation more precise about whether an unknown glyph at the start of a run should be included in a fallback run.
Comment 7 Commit Notification 2024-08-20 12:05:55 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

tdf#162358 Fix missing fallback run inside grapheme cluster

It will be available in 24.8.1.

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.