Bug 150145 - Missing row of pixels in tiled rendered text after pressing Enter in document
Summary: Missing row of pixels in tiled rendered text after pressing Enter in document
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.5.0 target:7.4.0.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2022-07-26 07:09 UTC by Aron Budea
Modified: 2022-07-27 07:16 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Sample ODT (15.31 KB, application/vnd.oasis.opendocument.text)
2022-07-26 07:09 UTC, Aron Budea
Details
Screenshot (buggy) (48.68 KB, image/png)
2022-07-26 07:10 UTC, Aron Budea
Details
Screenshot (as the numbers should look like) (48.74 KB, image/png)
2022-07-26 07:11 UTC, Aron Budea
Details
Simpler test document. (15.38 KB, application/vnd.oasis.opendocument.text)
2022-07-26 12:31 UTC, Miklos Vajna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2022-07-26 07:09:01 UTC
Created attachment 181411 [details]
Sample ODT

Open the attached document in gtktiledviewer in a local build, eg. using the following command:
bin/run gtktiledviewer $PWD/instdir/program <file name with location>

Find the → near the end of the document, and press Enter after it.

=> Note how the top row of pixels in the line "123456789" disappears (visible in digits 1 and 4).

This started happening after the following commit in 7.4:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=bb495c6a2f00346698a041bce69a5a97effc79d7
author		Caolán McNamara <caolanm@redhat.com>	2022-01-17 12:48:43 +0000
committer	Caolán McNamara <caolanm@redhat.com>	2022-01-17 17:23:18 +0100

"tdf#144862 set default render mode to LayoutAndMatchRender"

Since this commit only sets the new glyph positioning mode as default, the bug can be checked in older builds by setting the config item 'GlyphPositioningMode' to 2 manually. This config was introduced by the first commit in this series, and has been removed since:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=39a57fa8c047227060915534e64c4e90affa4b1a

Since the characters are shown correctly in the above "earliest" commit, the bug could be bibisected further, which pointed to the following commit:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=935761709fb7629c8d23aa5dc8bfcbd2988f5bbf
author		Caolán McNamara <caolanm@redhat.com>	2022-01-12 20:44:37 +0000
committer	Caolán McNamara <caolanm@redhat.com>	2022-01-13 20:26:25 +0100

"tdf#144862 adjust positioning experimental options"
Comment 1 Aron Budea 2022-07-26 07:10:47 UTC
Created attachment 181412 [details]
Screenshot (buggy)
Comment 2 Aron Budea 2022-07-26 07:11:41 UTC
Created attachment 181413 [details]
Screenshot (as the numbers should look like)
Comment 3 Caolán McNamara 2022-07-26 08:39:04 UTC
https://cgit.freedesktop.org/libreoffice/core/commit/?id=496426503675c6da60c6f3cd78549c8a70a8c694 was a little similar to this, but doesn't seem to be the issue in this case
Comment 4 Caolán McNamara 2022-07-26 11:41:51 UTC
seems to be actually rendered like this, i.e. not something we're cutting off
Comment 5 Caolán McNamara 2022-07-26 12:27:07 UTC
https://gitlab.freedesktop.org/cairo/cairo/-/issues/390 is very similar sounding
Comment 6 Miklos Vajna 2022-07-26 12:29:18 UTC
In CairoTextRender::DrawTextLayout(), if we hit the case that eHintStyle is CAIRO_HINT_STYLE_DEFAULT, then we'll transition to CAIRO_HINT_STYLE_SLIGHT, and the output is bad. If default is handled like none or slight, then we don't call cairo_font_options_set_hint_style(), and the output is good.

I need to read more code to understand if this would be a correct fix or not, perhaps you know. :-)
Comment 7 Miklos Vajna 2022-07-26 12:31:14 UTC
Created attachment 181418 [details]
Simpler test document.

With this, you don't need to do any interaction, you can just run 'bin/run gtktiledviewer --lo-path=$PWD/instdir/program /path/to/test.odt' and see the good/bad output immediately.
Comment 8 Miklos Vajna 2022-07-26 13:03:49 UTC
https://gerrit.libreoffice.org/c/core/+/137467 is a possible fix for this bug
Comment 9 Commit Notification 2022-07-26 19:06:15 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/59cfcd863b483a99491e6f8cd30016386bbff870

tdf#150145 text appears to have a row of pixels cropped out

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 10 Commit Notification 2022-07-27 07:16:19 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

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

tdf#150145 text appears to have a row of pixels cropped out

It will be available in 7.4.0.2.

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.