Bug 156234 - Subtle glyph misalignment with several fonts
Summary: Subtle glyph misalignment with several fonts
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
7.3.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: ⁨خالد حسني⁩
URL:
Whiteboard: target:24.2.0
Keywords: bibisected, bisected
Depends on:
Blocks: Font-Rendering
  Show dependency treegraph
 
Reported: 2023-07-11 09:55 UTC by ⁨خالد حسني⁩
Modified: 2024-02-29 11:44 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Document using Duployan (9.13 KB, application/vnd.oasis.opendocument.text)
2023-07-11 09:58 UTC, ⁨خالد حسني⁩
Details
Test document (with embedded fonts) (1.29 MB, application/vnd.oasis.opendocument.text)
2023-07-11 11:53 UTC, ⁨خالد حسني⁩
Details
screenshot of first paragraph at different zoom levels in LO 7.5.4 (60.13 KB, image/png)
2023-07-11 14:52 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ⁨خالد حسني⁩ 2023-07-11 09:55:56 UTC
With some fonts where glyphs are attached together, rendering in LibreOffice at small sizes shows subtle misalignment of the attached glyphs i.e. they don’t perfectly attach.

This is likely caused by our early rounding of glyph coordinates, so even when map mode is used which should provide high fidelity positioning, we round the glyph coordinates before map mode conversion from font units to logical units takes place.
Comment 1 ⁨خالد حسني⁩ 2023-07-11 09:58:15 UTC
Created attachment 188309 [details]
Document using Duployan

This uses https://github.com/dscorbett/duployan-test/blob/gh-pages/assets/fonts/Duployan-Regular.otf

Even in highdpi displays, the glyphs are not attached together correctly.
Comment 2 ⁨خالد حسني⁩ 2023-07-11 11:53:49 UTC
Created attachment 188311 [details]
Test document (with embedded fonts)

Here is a test document with a texts in three different fonts (fonts are embedded in the document).

Zooming in and out can show subtle glyph alignment issues.
Comment 3 Stéphane Guillou (stragu) 2023-07-11 14:52:31 UTC
Created attachment 188315 [details]
screenshot of first paragraph at different zoom levels in LO 7.5.4

Khaled, is this part of the issue you are describing?
Comment 4 ⁨خالد حسني⁩ 2023-07-11 16:28:59 UTC
(In reply to Stéphane Guillou (stragu) from comment #3)
> Created attachment 188315 [details]
> screenshot of first paragraph at different zoom levels in LO 7.5.4
> 
> Khaled, is this part of the issue you are describing?

Yes. You can see more examples in the Arabic text as well if you look closely (I should take some screenshots).
Comment 5 Stéphane Guillou (stragu) 2023-07-11 17:00:36 UTC
Looking at the first Duployan paragraph, glyphs were all over the place before 7.3.

Since Julien's update to harfbuzz 2.8.2 in ed29da546754d0d11aa0cffd4dfe649cc95df722, situation improved but the reported subtle misalignment remained.

Bibisected with linux-64-7.3 repo, but not marking as a regression.
Comment 6 ⁨خالد حسني⁩ 2023-07-11 20:12:44 UTC
Yes, I don’t think there is a regression here. In 7.4x the on screen rendering has improved greatly. This issue is tracking the last bits of these positioning issues.

I’m working on a patch already: https://gerrit.libreoffice.org/c/core/+/154292
Comment 7 Commit Notification 2023-07-23 04:02:33 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4b743de97fc133623e46827869c4ea3eb845ad47

tdf#156234: Don’t round glyph coordinates when doing subpixel positioning

It will be available in 24.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 8 Stéphane Guillou (stragu) 2023-07-26 09:59:03 UTC
I still see very subtle misalignments but it is greatly improved compared to 7.5.5 and barely noticeable.

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 24d0a62bd75b9a895c419aa165da648ab18f134d
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Marking as verified. Thanks!