Bug 99584 - Optimal-width columns too small to print (data appears as '#' chars)
Summary: Optimal-width columns too small to print (data appears as '#' chars)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Font-Rendering Cell-Management
  Show dependency treegraph
 
Reported: 2016-04-30 02:16 UTC by Jim Avera
Modified: 2024-02-29 11:44 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Demo which prints wrongly (13.05 KB, application/x-vnd.oasis.opendocument.spreadsheet)
2016-04-30 02:16 UTC, Jim Avera
Details
Screenshot (in case it depends on my fonts or something) (29.18 KB, image/png)
2016-04-30 02:18 UTC, Jim Avera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Avera 2016-04-30 02:16:48 UTC
Created attachment 124742 [details]
Demo which prints wrongly

If all columns are set to "Optimal Column Width", then when the spreadsheet is printed, some columns of numbers appear as "###" instead of the numbers which are visible in the normal spreadsheet view.

Whether or not this happens seems to exquisitely depend on the font used and the exact magnification of the table when printing, etc.

Attached is an example document.

STEPS TO REPRODUCE:

1. Open attached "hashchars_when_printed.ods"
2. Click in corner to select all cells
3. Place cursor in column-header-row and RightClick->Optimal Column Width...
   Set "Add" to 0.  Click OK.
4. Print the page, or File->PagePreview

RESULTS:  Nothing but "###"
EXPECTED RESULTS: WYSIWYG (i.e. the numbers shown in the spreadsheet should appear)
Comment 1 Jim Avera 2016-04-30 02:18:38 UTC
Created attachment 124743 [details]
Screenshot (in case it depends on my fonts or something)
Comment 2 m_a_riosv 2016-04-30 23:52:04 UTC
Reproducible.
Win10x64
Version: 5.1.3.1 (x64)
Build ID: 115e0e13d3c8ac1452186ad2394abce2dd5c2b57
CPU Threads: 1; OS Version: Windows 6.19; UI Render: default; 

1) Happens with Menu/Tools/Options/LibreOffice calc/General - Use printer metrics for text formatting, enable.

2) Doesn't happen with double click in the line between columns header.
Comment 3 Cor Nouws 2016-05-03 12:40:29 UTC
Maybe this should be component "Printing and PDF export?"
Any idea if this was OK in other versions?
Comment 4 Jim Avera 2016-05-03 16:55:03 UTC
> Any idea if this was OK in other versions?

4.2 is the earliest build I checked.  The bug *is* present in the latest builds (5.2 alpha))
Comment 5 QA Administrators 2017-05-22 13:40:17 UTC Comment hidden (obsolete)
Comment 6 Jim Avera 2017-05-22 18:20:54 UTC
Yes, bug is still there in master from 4/9/17

Version: 5.4.0.0.alpha0+ Build ID: 0bc1e8104719b1ed9f8271f9dde407f10fb88df0

I will attach screen-shots showing the spreadsheet before printing, and printed results (please follow the "Steps to Reproduce" to make it happen yourself).

-> The key problem is that setting "Optimal Width" columns with zero extra space causes wrong printing with certain data.   

Using zero extra space is necessary with many data sets containing numerous columns, so this can be a royal pain (you have to check printing with each data set and manually tweek a few columns to avoid the bug; but doing so can make data fall off the right edge of the paper, so you have to re-jigger other columns as well to shrink them.
Comment 7 Jim Avera 2017-05-22 19:18:34 UTC
(I won't attach new screen-shots; the original is sufficient).

BTW, the smallest possible "Add:" amount in Optimal Column Width is 0.1" (anything smaller is either rounded up to 0.1" or down to zero).   0.1" is too large when there are many columns, because the extra space adds up and the data no longer fits on the page (or screen).

So it would be helpful if this bug is fixed so that zero "Add" can be used reliably.
Comment 8 QA Administrators 2018-05-23 02:36:20 UTC Comment hidden (obsolete)
Comment 9 Jim Avera 2018-05-23 20:00:53 UTC
The bug is still there in master 
Version: 6.1.0.0.alpha1+
Build ID: 8fae8a6cd73b7262c3739bd4acc5c72b54934ff1
CPU threads: 12; OS: Linux 4.15; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2018-05-22_22:32:05
Locale: en-US (en_US.UTF-8); Calc: group
Comment 10 QA Administrators 2019-05-24 02:56:32 UTC Comment hidden (obsolete)
Comment 11 QA Administrators 2021-05-24 04:27:39 UTC Comment hidden (obsolete)
Comment 12 Stéphane Guillou (stragu) 2024-02-29 06:43:56 UTC
I don't have the "Sans" font used.

In OOo 3.3, LO 6.0 and 7.6, font makes a difference:
- with fallback, shows numbers on canvas but ### on print preview. (as OP)
- with Liberation Sans, numbers shown in both cases. (OK)

Version: 7.6.5.2 (X86_64) / LibreOffice Community
Build ID: 38d5f62f85355c192ef5f1dd47c5c0c0c6d6598b
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

In 24.2 and 24.8, results are the same regardless of if I use Liberation Sans or the fallback font: ### on canvas, but numbers shown in print preview. So the opposite of what OP describes!

Version: 24.2.1.1 (X86_64) / LibreOffice Community
Build ID: 359ef544e625d2ffbfced462ab37bd593ca85fa7
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

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

Maybe that recent change is related to bug 159945.

Note that the "use printer metrics" options were removed from the options dialog in LO 7.6 (see https://wiki.documentfoundation.org/ReleaseNotes/7.5#Feature_Removal_/_Deprecation and bug 131136).
Comment 13 Stéphane Guillou (stragu) 2024-02-29 06:46:05 UTC
(note that issue on canvas might depend on zoom level, so please always test at 100%)
Comment 14 Stéphane Guillou (stragu) 2024-02-29 11:44:57 UTC
(In reply to Stéphane Guillou (stragu) from comment #12)
> In 24.2 and 24.8, results are the same regardless of if I use Liberation
> Sans or the fallback font: ### on canvas, but numbers shown in print
> preview. So the opposite of what OP describes!
In libreoffice-64-24.2 bibisect repo, this started at build [4ce9836c2406d6fc50482782ef4675b5e5078edb] which is:

commit 4b743de97fc133623e46827869c4ea3eb845ad47
author	Khaled Hosny 	Mon Jul 17 12:38:41 2023 +0300
committer	خالد حسني 	Sun Jul 23 06:01:56 2023 +0200
tdf#156234: Don’t round glyph coordinates when doing subpixel positioning
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154292

I think this is a better situation than the other way round (i.e. having the bad surprise of printing ### instead of numbers), and this report could be closed as fixed, but any thoughts on the issue on canvas, Khaled?