Bug 143978 - Calc: shrink to fit makes font size unnecessary small compared to cell width
Summary: Calc: shrink to fit makes font size unnecessary small compared to cell width
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.4.0.3 release
Hardware: x86-64 (AMD64) Windows (All)
: high normal
Assignee: Luboš Luňák
URL:
Whiteboard: target:7.3.0 target:7.2.3
Keywords: bibisected, bisected, regression
: 143659 144310 144381 144707 144805 144810 144951 145733 145736 145772 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-08-20 16:53 UTC by Brijesh David
Modified: 2022-11-18 14:01 UTC (History)
19 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (7.96 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-08-26 15:12 UTC, Telesto
Details
If the cell is aligned top and the width is just a little smaller (38.95 KB, image/jpeg)
2021-10-17 04:11 UTC, Tamo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brijesh David 2021-08-20 16:53:06 UTC
Description:
LibreOffice 7.2
Calc: a cell with shrink to fit - too much shrink the content if it is not fit.

Steps to Reproduce:
1.right click on a cell or select a cell and go to format>Cells..
2.select alignment tab
3.check "shrink to fit"
4.enter content that can not fit in the cell

Actual Results:
when we enter content that can not fit in the cell it should shrink gradually but it shrink too much.

Expected Results:
when we enter content that can not fit in the cell it should shrink gradually but it shrink too much.


Reproducible: Always


User Profile Reset: No



Additional Info:
when we enter content that can not fit in the cell it should shrink gradually but it shrink too much.
Comment 1 Dmitrii A 2021-08-21 02:34:52 UTC
no repro in

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: ac80ec817eb07c77a51bc0729985a473c734182e
CPU threads: 16; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL

Content shrinks gradualy due to the number of simbols.
Comment 2 Telesto 2021-08-26 15:12:45 UTC
Created attachment 174563 [details]
Example file

STR (hope I understand it correctly)

1. Open the attached file
2. Cell A8 has size adjusted manually from 10 to 9 to fit the cell
3. Cell A9 has shrink to fit enabled, and makes font unnecessary smaller

Repro with
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: f58f35b2c8ca1efbacec642a8f3de5b0c499bc6b
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 3 Telesto 2021-08-26 15:20:07 UTC
Also in
6.4

6.1

and in
Version: 6.0.6.0.0+ (it renders correctly on open but suddenly becomes smaller)
Build ID: c30963b8b4bbbe42a24b97aafa161eff9d7ccdd4
CPU threads: 4; OS: Windows 6.3; UI render: GL; 
Locale: nl-NL (nl_NL); Calc: CL

and in
Version: 5.4.0.2
Build ID: 2b906d450a44f2bbe506dcd22c51b3fa11dc65fd
CPU threads: 4; OS: Windows 6.2; UI render: default; 
Locale: nl-NL (nl_NL); Calc: CL


slightly smaller compared to A8
Version: 5.3.0.2
Build ID: 5ad7b2889021c491af62f7930a4b1cb631392f16
CPU Threads: 4; OS Version: Windows 6.2; UI Render: default; Layout Engine: new; 
Locale: nl-NL (nl_NL); Calc: group


Fine in
Versie: 5.2.4.2 
Build ID: 3d5603e1122f0f102b62521720ab13a38a4e0eb0
CPU Threads: 4; Versie besturingssysteem:Windows 6.2; UI Render: GL; 
Locale: nl-NL (nl_NL); Calc: CL
Comment 4 Aron Budea 2021-08-31 02:14:28 UTC
I could reproduce this in Linux, and while the sizes vary in different older versions, the really small text in A8 in the example from comment 2 started from the following commit, bibisected using repo bibisect-linux-64-7.2. Adding CC: to Luboš Luňák on this case.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=d62ad3efe3c8778cfda00799f1cd7bb3349e0b75
author		Luboš Luňák <l.lunak@collabora.com>	2021-01-19 18:58:25 +0100
committer	Luboš Luňák <l.lunak@collabora.com>	2021-01-21 11:33:31 +0100

cache SalLayoutGlyphs in ScOutputData::LayoutStrings()
Comment 5 m_a_riosv 2021-09-06 13:44:09 UTC
*** Bug 144310 has been marked as a duplicate of this bug. ***
Comment 6 Igor 2021-09-06 16:42:54 UTC
Bug 144310: The text in cell is not only too small, but the end of the line is truncated (!)
Comment 7 m_a_riosv 2021-09-08 17:13:47 UTC
*** Bug 144381 has been marked as a duplicate of this bug. ***
Comment 8 Buovjaga 2021-09-24 17:31:34 UTC
*** Bug 144707 has been marked as a duplicate of this bug. ***
Comment 9 raal 2021-09-25 14:41:49 UTC
bisected in comment 4, tweaking keywords
Comment 10 m_a_riosv 2021-09-30 11:48:16 UTC
*** Bug 144810 has been marked as a duplicate of this bug. ***
Comment 11 m_a_riosv 2021-09-30 13:58:10 UTC
*** Bug 144805 has been marked as a duplicate of this bug. ***
Comment 12 Eike Rathke 2021-10-05 21:53:49 UTC
*** Bug 144951 has been marked as a duplicate of this bug. ***
Comment 13 Eike Rathke 2021-10-05 21:57:50 UTC Comment hidden (obsolete)
Comment 14 m_a_riosv 2021-10-15 20:19:00 UTC
Still
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 9bcdfcb74dae7ccd07be7159c0e1deba110d2a6f
CPU threads: 4; OS: Windows 10.0 Build 21390; UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL
Comment 15 Tamo 2021-10-17 04:11:03 UTC
Created attachment 175788 [details]
If the cell is aligned top and the width is just a little smaller

Moreover, if the cell is top-aligned and the width is just a little smaller for the text, the content will overflow a half.

See the screenshot (version 7.2.2.2).
B2 is affected by both Bug 143659 and Bug 143978.
C2 is sticking out of the top.
D2 is Ok.
Comment 16 Luboš Luňák 2021-10-19 10:04:48 UTC
*** Bug 143659 has been marked as a duplicate of this bug. ***
Comment 17 Commit Notification 2021-10-19 14:09:46 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6ee4ce119b55d6e415696b23432fe65eabc94c17

consider font when caching SalLayoutGlyphs in calc (tdf#143978)

It will be available in 7.3.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 18 m_a_riosv 2021-10-19 20:39:01 UTC
Thank you Luboš, it's been a very annoying issue.

Would be nice having it solved also with 7.2
Comment 19 Commit Notification 2021-10-20 05:34:23 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

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

consider font when caching SalLayoutGlyphs in calc (tdf#143978)

It will be available in 7.2.3.

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 20 Tamo 2021-10-23 04:18:11 UTC
Confirmed. Oct 22 dev build of 7.2.3 handles "shrink to fit" correctly.
Comment 21 Kevin Suo 2021-11-17 13:20:39 UTC
*** Bug 145733 has been marked as a duplicate of this bug. ***
Comment 22 m_a_riosv 2021-11-17 17:56:24 UTC
*** Bug 145736 has been marked as a duplicate of this bug. ***
Comment 23 Commit Notification 2021-11-17 18:35:58 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2678f500fa4cf20a83c29fc28969efa71027b1ec

tdf#143978: sc_pdf_export: Add unittest

It will be available in 7.3.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 24 m_a_riosv 2021-11-17 18:41:46 UTC
Verified
Version: 7.2.3.1 (x64) / LibreOffice Community
Build ID: 1d5dee817bde88d78dbcc0d00f88492568e131d5
CPU threads: 4; OS: Windows 10.0 Build 21390; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL
Comment 25 Buovjaga 2022-11-18 14:01:38 UTC
*** Bug 145772 has been marked as a duplicate of this bug. ***