Bug 167639 - Currency symbol alignment can still be incorrect
Summary: Currency symbol alignment can still be incorrect
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.2.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Font-Rendering Calc-Cells
  Show dependency treegraph
 
Reported: 2025-07-23 01:13 UTC by Aron Budea
Modified: 2025-07-24 12:44 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample ODS (16.03 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-07-23 01:13 UTC, Aron Budea
Details
Screenshot from before bug 160786 (89.09 KB, image/png)
2025-07-23 01:15 UTC, Aron Budea
Details
Screenshot after bug 160786 got fixed (93.03 KB, image/png)
2025-07-23 01:16 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2025-07-23 01:13:09 UTC
Created attachment 201943 [details]
Sample ODS

This is a follow-up to bug 160786.
If you open the attached sample, you can see that the alignment is visibly off in cells B10/11 and B14.

If you compare it with an older build, before the issue reported in bug 160786 (before 24.2), there are further subtle differences:
- in column A, in the old version the single digit numbers (<10) are aligned differently than the double digit ones (>=10), in the new version the alignment is uniform in the whole column (here the new version might be better, though it does leave a bit more space before the currency symbol)
- in column B, except B10/11 + B14, there is similar between <10 and >=10 numbers, but here the currency symbols are aligned further left.

The bug report is primarily about the alignment in in B10/11 and B14.

Observed in LO 26.2.0.0.alpha0+ (8b60950947e8017b1f0b30538b6ef9a3bab51bee) / Ubuntu, at 100% zoom and display scaling.

For reference, the alignment went really bad with the following commit in 24.2:
https://git.libreoffice.org/core/commit/4b743de97fc133623e46827869c4ea3eb845ad47
author		Khaled Hosny <khaled@libreoffice.org>	Mon Jul 17 12:38:41 2023 +0300
committer	خالد حسني <khaled@libreoffice.org>	Sun Jul 23 06:01:56 2023 +0200

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

Then it got improved by this commit in 24.8:
https://git.libreoffice.org/core/commit/089398e51409458c5438c49fb347e4f09d9c09dc
author		Mike Kaganski <mike.kaganski@collabora.com>	Thu Apr 18 13:18:37 2024 +0500
committer	Mike Kaganski <mike.kaganski@collabora.com>	Sat Apr 20 08:53:26 2024 +0200

"Return double from OutputDevice::GetTextArray"

And finally ended up in the current state after this commit in 25.2 and its 24.8 backport:
https://git.libreoffice.org/core/commit/981c5780da8ec6b6878de58909b7cc7e736ad33a
author		Jonathan Clark <jonathan@libreoffice.org>	Tue Aug 06 06:01:57 2024 -0600
committer	Jonathan Clark <jonathan@libreoffice.org>	Tue Aug 06 21:57:10 2024 +0200

"tdf#160786 sc: Fix repeat char format code inaccuracy"
Comment 1 Aron Budea 2025-07-23 01:15:09 UTC
Created attachment 201944 [details]
Screenshot from before bug 160786
Comment 2 Aron Budea 2025-07-23 01:16:15 UTC
Created attachment 201945 [details]
Screenshot after bug 160786 got fixed
Comment 3 mkt 2025-07-24 09:13:22 UTC
This is reproducible in Version: 25.2.5.2 (X86_64) / LibreOffice Community
Build ID: 03d19516eb2e1dd5d4ccd751a0d6f35f35e08022
CPU threads: 2; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: default
Comment 4 Jonathan Clark 2025-07-24 12:36:41 UTC
Something to note is that Calc does not have a currency symbol alignment feature. What these documents use is a format code that repeats the space character until just before the cell overflows. With this design, neatly-aligned currency symbols should only be expected if you're using a fixed-width font.

My vote is either making this an enhancement request for a proper whitespace alignment feature, or NAB.
Comment 5 Mike Kaganski 2025-07-24 12:44:10 UTC
(In reply to Jonathan Clark from comment #4)
> My vote is either making this an enhancement request for a proper whitespace
> alignment feature, or NAB.

This is NAB. The specific feature has nothing to do with alignment at all; it is documented [1] to "fill free space with a given character" - there is no provision for "expansion of the character width by any ratio or to any given width". Integral number of characters, put together, using the character glyph size.

A feature request needs an own ticket, and will indeed use a different syntax (if implemented as a format string at all), so would not "fix" this document.

[1] https://help.libreoffice.org/25.8/en-US/text/shared/01/05020301.html?&DbPAR=CALC#hd_id3154330