Bug 152533 - Font preview in Characters dialog uses the wrong font for common characters
Summary: Font preview in Characters dialog uses the wrong font for common characters
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: ⁨خالد حسني⁩
URL:
Whiteboard: target:7.6.0 target:7.5.0.0.beta2
Keywords:
Depends on:
Blocks: RTL-CTL Character-Dialog Font-Preview
  Show dependency treegraph
 
Reported: 2022-12-15 22:08 UTC by ⁨خالد حسني⁩
Modified: 2022-12-30 16:39 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Screenhost showing the difference between document text and preview (356.46 KB, image/png)
2022-12-15 22:08 UTC, ⁨خالد حسني⁩
Details
Test document (11.26 KB, application/vnd.oasis.opendocument.text)
2022-12-15 22:09 UTC, ⁨خالد حسني⁩
Details
Test document using bundled fonts + more testcases (13.12 KB, application/vnd.oasis.opendocument.text)
2022-12-16 08:41 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ⁨خالد حسني⁩ 2022-12-15 22:08:34 UTC
Created attachment 184163 [details]
Screenhost showing the difference between document text and preview

This is the same issue as bug 152460, but for font preview in Characters dialog. 

Common characters like punctuation and digits use the wrong font, and because of the the preview renders text, this breaks text order as well.
Comment 1 ⁨خالد حسني⁩ 2022-12-15 22:09:14 UTC
Created attachment 184164 [details]
Test document
Comment 2 Commit Notification 2022-12-16 06:05:55 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/718af940435ae9d2ac90374e5880ecb38e96252c

tdf#152533: Improve script handling in font preview

It will be available in 7.6.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 3 Eyal Rozenberg 2022-12-16 08:40:21 UTC
(In reply to خالد حسني from comment #0)
> Created attachment 184163 [details]
> Screenhost showing the difference between document text and preview

To try to characterize the problem:

The 1 is rendered using the Western-language-group font glyph in the preview, and using the RTL-CTL-language-group font glyph in the document. This may not be super-clear from the screenshot to people who are not familiar with the numerals of Amiri and Reem Kufi (especially since not everyone has Reem Kufi on their system...)

This naturally also happens with Hebrew. Plus - it doesn't matter that the digit is at the end of the line, so it's not a matter of a direction-neutral character with its ambiguity, i.e. it's not a שלום. vs .שלום flipping issue.

I'll attach a document using only bundled font and a couple of examples in Hebrew as well.

Thanks for the fix, Khaled :-)
Comment 4 Eyal Rozenberg 2022-12-16 08:41:08 UTC
Created attachment 184175 [details]
Test document using bundled fonts + more testcases
Comment 5 ⁨خالد حسني⁩ 2022-12-16 08:56:47 UTC
(In reply to Eyal Rozenberg from comment #3)

> (especially since not everyone has Reem Kufi on their system...)

Both fonts are bundled.
Comment 6 Commit Notification 2022-12-16 18:39:28 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/3e7e5dad9d8442a74a5d51dddca655b6073d0ff2

tdf#152533: Improve script handling in font preview

It will be available in 7.5.0.0.beta2.

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.