Bug 163235 - Text in textbox not vertically-centered when line spacing is not single
Summary: Text in textbox not vertically-centered when line spacing is not single
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectRequest
Depends on:
Blocks: Textbox
  Show dependency treegraph
 
Reported: 2024-10-01 14:00 UTC by Eyal Rozenberg
Modified: 2024-10-21 10:14 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Impress slide with three different line spacing values (19.54 KB, application/vnd.oasis.opendocument.presentation)
2024-10-01 14:00 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-10-01 14:00:28 UTC
Created attachment 196823 [details]
Impress slide with three different line spacing values

When I enter text into a text box which has been vertically-aligned to center, (and especially when the text fits into a single line), I expect the vertical center of the line of text to be the same as the center-line crossing the text box.

If my text has Single line spacing for its paragraph properties, LO's v-placement behavior is placing the center-line on the mid-line between the ascent and the bottom [1]. This is already somewhat questionable (what if I don't use initials?) - but let's say that I can live with the choice.

However, if I set my paragraph to have higher, or lower, line spacing - the text is moved vertically! Upwards, for paragraph spavcing 0.5 and downwards for 2.0. That should definitely not happen.

I believe this is an old-time problem, not new behavior.


 [1]: https://i.sstatic.net/LwZJF.png
Comment 1 Eyal Rozenberg 2024-10-01 14:01:11 UTC
Seen just for example, with:

Version: 24.8.1.2 (X86_64) / LibreOffice Community
Build ID: 87fa9aec1a63e70835390b81c40bb8993f1d4ff6
CPU threads: 4; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US
Comment 2 Tomaz Vajngerl 2024-10-01 15:03:42 UTC
(In reply to Eyal Rozenberg from comment #0)
>  [1]: https://i.sstatic.net/LwZJF.png

I get access denied for this image - could be only me however.
Comment 3 Regina Henschel 2024-10-01 18:26:59 UTC
I see the correct, expected behavior in version 5.2.6.2.
I see the text not centered in version 6.1.3.2. and in current Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: f7fbf6504fd6190187f6e4d092af880ba8c7bf6a
CPU threads: 32; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: threaded

I have not tested versions in-between.

As Powerpoint renders it the same wrong way, I guess, the wrong behavior was introduced for compatibility reasons. I don't know whether there exists a flag to get the old, correct rendering.
Comment 4 Regina Henschel 2024-10-01 20:37:37 UTC
After some more tests with versions I have on my disk:

It is OK in
Version: 6.1.0.0.alpha0+ (x64)
Build ID: d73857e7d7f6a5bf38c6a2f396832faabaef65e2
CPU threads: 32; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@62-TDF, Branch:master, Time: 2017-12-12_17:37:14
Locale: de-DE (de_DE); Calc: group threaded

It becomes wrong, but different from current version in
Version: 6.1.0.0.alpha0+ (x64)
Build ID: cae52b77d48916d819e788675f40da5fe4f7c99c
CPU threads: 32; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-01-21_00:33:18
Locale: de-DE (de_DE); Calc: CL

and stays that way till
Version: 6.1.0.0.alpha0+ (x64)
Build ID: 715114595e0feec49c4d54cc5eb26f13dccb7968
CPU threads: 32; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-02-06_02:09:50
Locale: de-DE (de_DE); Calc: CL

Then it got worse in
Version: 6.1.0.0.alpha0+
Build ID: 32f42d093d4408666151d03f04823e2bb39e46cd
CPU threads: 32; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-03-13_23:25:09
Locale: de-DE (de_DE); Calc: CL

And have become more worse in
Version: 6.1.0.0.alpha0+ (x64)
Build ID: d39a8e791618a40328c0f90bece3cc246dcf57f7
CPU threads: 32; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-04-06_00:59:07
Locale: de-DE (de_DE); Calc: CL

And that is the current state.

I hope it helps QA in bibisect.
Comment 5 Eyal Rozenberg 2024-10-01 20:51:58 UTC
(In reply to Tomaz Vajngerl from comment #2)
> I get access denied for this image - could be only me however.

Not sure why. Try this page:
http://www.cyrilchandelier.com/understanding-fonts-and-uifont

anyway, it's just for illustrating the metrics.

Also, I can't say for sure if the centering is on (ascent - baseline)/2 or (capheight - baseline)/2

(In reply to Regina Henschel from comment #4)

Thanks for the semi-bibisection :-)

I remember we had this bug about creating an MS Office Compatibility rubrique in other modules, like we have in Writer. We could put such a setting in there (but I of course would expect the bug-for-bug compatibility to be off by default).
Comment 6 Telesto 2024-10-19 00:48:07 UTC
Removing needsUXEval, it'a bug. Adding bibisectRequest.
Comment 7 Eyal Rozenberg 2024-10-19 08:27:59 UTC
(In reply to Telesto from comment #6)
> Removing needsUXEval, it'a bug. Adding bibisectRequest.

It may not be that simple; see the more general bug 163520.