Bug 156364

Summary: Fonts are displayed slightly different on Linux, which causes the characters to overlap
Product: LibreOffice Reporter: Hossein <hossein>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: UNCONFIRMED ---    
Severity: normal CC: aron.budea, ilmari.lauhakangas, jonathan, khaled, stephane.guillou, telesto
Priority: medium    
Version: 24.2.0.0 alpha0+   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=144862
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 71732    
Attachments: Comparing output in Linux and Windows
PDF output from LibreOffice on Windows
PDF output from LibreOffice on Linux
Screencast comparing output from Windows and Linux

Description Hossein 2023-07-19 00:14:48 UTC
Created attachment 188456 [details]
Comparing output in Linux and Windows

Description:
With Harfbuzz as the font rendering engine in LibreOffice, it is expected that font rendering output on display and print are the same on different platforms. But, in reality there are slight differences. For example, in this case fonts are displayed slightly different on Linux, which causes the characters to overlap.

Steps to Reproduce:
1. Open attachment 188277 [details] in LO Writer dev master on Windows
2. Open the same file in LO Writer dev master on Linux
3. Compare the outputs on Windows and Linux display

Actual Results:
The outputs on display are different, and the characters sometimes overlap. For example, in the last line the starting » falls on the next character, which is ب and there is not (slight) space between them. Please look at «به همین دلیل» and other places in the start of double quotes «».

Expected Results:
Output on display in different platforms should be similar, and anyway the characters should not overlap in different zoom levels. There should be a slight space between » and ب in the last line.

For a comparison, the results are normalized (for size) and compared side by side in the attachment with 110% zoom level on both Windows and Linux. LO on Windows and Linux were built from the same git revision.


Reproducible: Always


User Profile Reset: No



Additional Info:
LO 24.2 dev master on Linux:
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: bb01ef3865c406f322d6e656faba2191aaeeb6da
CPU threads: 12; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: CL threaded

LO 24.2 dev master on Windows:
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: bb01ef3865c406f322d6e656faba2191aaeeb6da
CPU threads: 12; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 1 Hossein 2023-07-19 00:44:08 UTC
Created attachment 188458 [details]
PDF output from LibreOffice on Windows

Please note that the difference is on display, and I see no difference in PDF output. I am putting the PDF files here for the reference.
Comment 2 Hossein 2023-07-19 00:45:48 UTC
Created attachment 188459 [details]
PDF output from LibreOffice on Linux

As declared above, this is also for the reference. The difference is on display.
Comment 3 ⁨خالد حسني⁩ 2023-07-19 03:21:36 UTC
Looks like difference in DPI to me, does the Windows machine have a hidpi screen and Linux machine has a regular one?
Comment 4 Hossein 2023-07-19 09:53:08 UTC
(In reply to ⁨خالد حسني⁩ from comment #3)
> Looks like difference in DPI to me, does the Windows machine have a hidpi
> screen and Linux machine has a regular one?
Windows machine has a higher resolution and 3x scaling, Linux machine also uses 2x scaling. So, both are considered HIDPI.

qtdiag reports:

Linux machine
Physical DPI: 142 (approximate, slightly different on x and y)
Logical DPI: 192
DevicePixelRatio: 1

Windows machine
Physical DPI: 78 (approximate, the same on x and y)
Logical DPI: 96 (native 288)
DevicePixelRatio: 3

I scaled the Linux screenshot by the factor of 1.5 to create the combined screenshot.
Comment 5 Buovjaga 2023-09-05 15:50:35 UTC
I don't use display scaling. I installed B Nazanin font and looked at the example file. I don't see the overlap in any zoom level.

Arch Linux 64-bit, X11
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6ee0f9f02f7255339e18ab9e6189b2200bb71e6e
CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 5 September 2023
Comment 6 Stéphane Guillou (stragu) 2024-05-22 05:56:17 UTC
Can't see an overlap either on Ubuntu 22.04 + GNOME 42.9, 1× scaling, DPI 96×96, display 1600×900, with:

Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: ae798781ef4df7a1fdef13af0bc459bf4f6e7b4c
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded
Comment 7 Hossein 2024-05-22 11:27:40 UTC
Created attachment 194269 [details]
Screencast comparing output from Windows and Linux

This is a screencast created from the attachment 188456 [details] using GIMP, putting two outputs on Linux and Windows on different layers, showing/hiding them repeatedly.
Comment 8 Telesto 2024-05-23 02:43:37 UTC
Makes using different backends on the same linux machine any difference in font rendering?

FWIW: A test file with the required font embedded makes life easier and makes sure everyone using the same font version