View Issue Details

IDProjectCategoryView StatusLast Update
0014668ScribusStory Editor / Text Framespublic2022-12-10 17:42
Reporteritchka Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version1.5.3.svn 
Summary0014668: Adjust frame height to text fails if frame is not tall enough to display text.
DescriptionThe frame height until is bug has two components. If the frame has a single line but the frame is not tall enough to show it then 'Adjust frame to text height fails. If the text is multi-line but the frame is high enough to display at least one line the frame height will be adjusted so that just that line is displayed any other lines are ignored. Finally if all the lines in the frame are displayed selecting 'Adjust frame height to text' causes the frame height to be correctly set but causes the last character on the line to be deleted.
Because of the character deletion I have set this issue to major status.
Steps To Reproduce To reproduce, create a frame and add two lines of text. Centre the first line and left justify the second. Adjust the frame height so that only a single line is displayed. Select 'Adjust frame height to text' the frame will adjust itself to the single line displayed the second line will be ignored. Re-adjust the frame so that both lines are displayed and select 'Adjust frame height to text' the frame will be resized to both lines of text BUT the last character of the second line will be deleted.
Additional InformationThe character deletion may be the same thing that is happening in issue 0014666
TagsNo tags attached.
PatchNo

Relationships

related to 0015153 confirmed "Adjust Frame Height to Text" does not always work 
related to 0012190 confirmed Incorrect text align in textbox when applying "Adjust Frame Height to Text" (see last line) 

Activities

itchka

2017-03-10 11:51

reporter   ~0043554

Further investigation showed that the last character was not deleted but hidden. Increasing the height of the frame slightly as described in issue 0014666 restored the character. Adding a newline to the end of the text made no difference.

jghali

2017-03-10 12:44

administrator   ~0043555

>> If the text is multi-line but the frame is high enough to display at least one line the frame height will be adjusted so that just that line is displayed any other lines are ignored.

This is expected behavior. Adjusting height by taking into account all text would generally not work for linked frames.

>> Finally if all the lines in the frame are displayed selecting 'Adjust frame height to text' causes the frame height to be correctly set but causes the last character on the line to be deleted.

Unable to produce with current code. Please test with latest code before submitting bugs. 1.5.2 is outdated for us and 1.5.3.svn text layout code has considerably changed since 1.5.2.

itchka

2017-03-10 12:55

reporter   ~0043556

Well ok but 1.53svn is not a released version so it's never going to be used by the majority. I'll build it and test anyway though.

itchka

2017-03-12 08:14

reporter   ~0043572

Ok I have built 1.53svn and run the same tests. The nature of the bug has changed fitting the frame of a single line now renders the text invisible unless the line spacing is set to 'automatic line spacing'; with this setting it works. If the line spacing is set to 'align to baseline grid' or 'fixed line spacing' the frame is made too small and the text rendered invisible. If a second line is added left justified and the style for each line fitting the frame causes the second line of text to disappear irrespective of the line spacing setting. In summary then the only circumstance where a single line will not be deleted is when the text is set to 'automatic line spacing' and this will only work with a single line of text. I agree that the option should be disabled if the frame contains multiple lines and is linked to another but I see no reason why it should not work in a single frame with multiple lines of text.
ldd.txt (6,066 bytes)   
	linux-vdso.so.1 (0x00007ffc9d3ce000)
	libcairo.so.2 => /usr/lib64/libcairo.so.2 (0x00007f71893fc000)
	libQt5Xml.so.5 => /usr/lib64/libQt5Xml.so.5 (0x00007f71893c4000)
	libQt5Network.so.5 => /usr/lib64/libQt5Network.so.5 (0x00007f7189289000)
	libQt5PrintSupport.so.5 => /usr/lib64/libQt5PrintSupport.so.5 (0x00007f7189221000)
	libcups.so.2 => /usr/lib64/libcups.so.2 (0x00007f71891a7000)
	libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007f7189110000)
	libharfbuzz-icu.so.0 => /usr/lib64/libharfbuzz-icu.so.0 (0x00007f718910c000)
	libharfbuzz.so.0 => /usr/lib64/libharfbuzz.so.0 (0x00007f7189092000)
	libicuuc.so.55 => /usr/lib64/libicuuc.so.55 (0x00007f7188d1e000)
	libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007f7188cdf000)
	libtiff.so.5 => /usr/lib64/libtiff.so.5 (0x00007f7188c72000)
	libjpeg.so.8 => /usr/lib64/libjpeg.so.8 (0x00007f7188c0a000)
	libz.so.1 => /lib64/libz.so.1 (0x00007f7188bef000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f71889ec000)
	liblcms2.so.2 => /usr/lib64/liblcms2.so.2 (0x00007f7188996000)
	libpodofo.so.0.9.1 => /usr/lib64/libpodofo.so.0.9.1 (0x00007f7188851000)
	libQt5Widgets.so.5 => /usr/lib64/libQt5Widgets.so.5 (0x00007f7188289000)
	libQt5Gui.so.5 => /usr/lib64/libQt5Gui.so.5 (0x00007f7187e78000)
	libQt5Core.so.5 => /usr/lib64/libQt5Core.so.5 (0x00007f7187a3c000)
	libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f7187903000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f71878f0000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f71875f1000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f7187293000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f7187076000)
	libpixman-1.so.0 => /usr/lib64/libpixman-1.so.0 (0x00007f7186fe4000)
	libEGL.so.1 => /usr/lib64/libEGL.so.1 (0x00007f7186fa2000)
	libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007f7186f6f000)
	libxcb-shm.so.0 => /usr/lib64/libxcb-shm.so.0 (0x00007f7186f6b000)
	libxcb-render.so.0 => /usr/lib64/libxcb-render.so.0 (0x00007f7186f61000)
	libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f7186f42000)
	libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007f7186f38000)
	libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f7186e11000)
	libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007f7186e00000)
	libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007f7186d8d000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f7186b86000)
	libssl.so.1.0.0 => /lib64/libssl.so.1.0.0 (0x00007f7186b18000)
	libcrypto.so.1.0.0 => /lib64/libcrypto.so.1.0.0 (0x00007f71868c0000)
	libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00007f718687b000)
	libgnutls.so.30 => /usr/lib64/libgnutls.so.30 (0x00007f7186736000)
	libavahi-common.so.3 => /usr/lib64/libavahi-common.so.3 (0x00007f7186728000)
	libavahi-client.so.3 => /usr/lib64/libavahi-client.so.3 (0x00007f7186716000)
	libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f71866fe000)
	libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007f7186611000)
	libgraphite2.so.3 => /usr/lib64/libgraphite2.so.3 (0x00007f71865ed000)
	libicudata.so.55 => /usr/lib64/libicudata.so.55 (0x00007f7184b37000)
	libxml2.so.2 => /lib64/libxml2.so.2 (0x00007f71848f2000)
	liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f71848c6000)
	libjbig.so.1 => /usr/lib64/libjbig.so.1 (0x00007f71848b8000)
	/lib64/ld-linux-x86-64.so.2 (0x000055f1405ce000)
	libidn.so.11 => /usr/lib64/libidn.so.11 (0x00007f7184885000)
	libicui18n.so.55 => /usr/lib64/libicui18n.so.55 (0x00007f7184457000)
	libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007f71843dc000)
	libpcre16.so.0 => /usr/lib64/libpcre16.so.0 (0x00007f7184363000)
	libdouble-conversion.so.1 => /usr/lib64/libdouble-conversion.so.1 (0x00007f7184350000)
	libX11-xcb.so.1 => /usr/lib64/libX11-xcb.so.1 (0x00007f718434d000)
	libxcb-dri2.so.0 => /usr/lib64/libxcb-dri2.so.0 (0x00007f7184348000)
	libxcb-dri3.so.0 => /usr/lib64/libxcb-dri3.so.0 (0x00007f7184344000)
	libxcb-present.so.0 => /usr/lib64/libxcb-present.so.0 (0x00007f7184340000)
	libxcb-xfixes.so.0 => /usr/lib64/libxcb-xfixes.so.0 (0x00007f7184336000)
	libxcb-sync.so.1 => /usr/lib64/libxcb-sync.so.1 (0x00007f718432f000)
	libxshmfence.so.1 => /usr/lib64/libxshmfence.so.1 (0x00007f718432c000)
	libgbm.so.1 => /usr/lib64/libgbm.so.1 (0x00007f718431d000)
	libwayland-client.so.0 => /usr/lib64/libwayland-client.so.0 (0x00007f718430f000)
	libwayland-server.so.0 => /usr/lib64/libwayland-server.so.0 (0x00007f71842fd000)
	libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007f71842d0000)
	libdrm.so.2 => /usr/lib64/libdrm.so.2 (0x00007f71842be000)
	libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f71842ba000)
	libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007f71842b3000)
	libglapi.so.0 => /usr/lib64/libglapi.so.0 (0x00007f7184283000)
	libXdamage.so.1 => /usr/lib64/libXdamage.so.1 (0x00007f718427f000)
	libXfixes.so.3 => /usr/lib64/libXfixes.so.3 (0x00007f7184276000)
	libxcb-glx.so.0 => /usr/lib64/libxcb-glx.so.0 (0x00007f7184260000)
	libXxf86vm.so.1 => /usr/lib64/libXxf86vm.so.1 (0x00007f718425a000)
	libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00007f7184198000)
	libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00007f718416b000)
	libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f7184166000)
	libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00007f718415a000)
	libp11-kit.so.0 => /usr/lib64/libp11-kit.so.0 (0x00007f71840ff000)
	libunistring.so.2 => /usr/lib64/libunistring.so.2 (0x00007f7183f97000)
	libtasn1.so.6 => /usr/lib64/libtasn1.so.6 (0x00007f7183f86000)
	libnettle.so.6 => /usr/lib64/libnettle.so.6 (0x00007f7183f4f000)
	libhogweed.so.4 => /usr/lib64/libhogweed.so.4 (0x00007f7183f1b000)
	libgmp.so.10 => /usr/lib64/libgmp.so.10 (0x00007f7183e99000)
	libdbus-1.so.3 => /lib64/libdbus-1.so.3 (0x00007f7183e49000)
	libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f7183dc8000)
	liblz4.so.1 => /usr/lib64/liblz4.so.1 (0x00007f7183dac000)
	libgcrypt.so.20 => /lib64/libgcrypt.so.20 (0x00007f7183d0d000)
	libffi.so.6 => /usr/lib64/libffi.so.6 (0x00007f7183d03000)
	libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f7183cfc000)
	libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f7183ae9000)
	libgpg-error.so.0 => /lib64/libgpg-error.so.0 (0x00007f7183ad7000)
ldd.txt (6,066 bytes)   
bugtest.sla (16,764 bytes)

utnik

2017-03-12 14:08

updater   ~0043573

i can confirm the error with 'bugtest.sla' with scribus 1.5.3-r21794 on macos 10.11.6. (fonts replaced to 'linux biolinum o', as i don't have the originally used ones…)

some more strange things:

when i try to adjust he frame, it cuts the last line, but doesn't adjust properly to the first one. but when i tell scribus to adjust the already changed frame, id adjusts to the first line.

i then narrowed the frame width to have fife lines of text and repeated the experiment. now scribus 'eats' one line after another, always with some spare room below the last displayed line, until it stops with two lines and the frane ending just under the second one.

Fahad

2018-01-10 07:01

developer   ~0044827

@itchka & @utnik

This is also happen to Arabic text. I develop a small patch to fix this problem.

@jghali please test & merge.
fix-adjust-text-frame.patch (444 bytes)   
Index: scribus/text/boxes.cpp
===================================================================
--- scribus/text/boxes.cpp	(revision 22340)
+++ scribus/text/boxes.cpp	(working copy)
@@ -103,7 +103,7 @@
 		if (m_direction == D_Horizontal)
 			nH = qMax(m_naturalHeight, box->naturalHeight());
 		else
-			nH = ceil(box->y() + box->ascent() - box->naturalDecent());
+			nH = ceil(box->y() + box->ascent() - box->descent());
 	}
 	return nH;
 }
fix-adjust-text-frame.patch (444 bytes)   

Fahad

2018-01-11 04:17

developer   ~0044830

to be clear my patch fix this problem only:

"when i try to adjust he frame, it cuts the last line, but doesn't adjust properly to the first one. but when i tell scribus to adjust the already changed frame, id adjusts to the first line.

i then narrowed the frame width to have fife lines of text and repeated the experiment. now scribus 'eats' one line after another, always with some spare room below the last displayed line, until it stops with two lines and the frane ending just under the second one. "

Issue History

Date Modified Username Field Change
2017-03-10 11:15 itchka New Issue
2017-03-10 11:51 itchka Note Added: 0043554
2017-03-10 12:44 jghali Note Added: 0043555
2017-03-10 12:55 itchka Note Added: 0043556
2017-03-12 08:14 itchka File Added: ldd.txt
2017-03-12 08:14 itchka File Added: bugtest.sla
2017-03-12 08:14 itchka Note Added: 0043572
2017-03-12 14:08 utnik Note Added: 0043573
2017-03-12 14:09 utnik Product Version 1.5.2 => 1.5.3.svn
2018-01-10 07:01 Fahad File Added: fix-adjust-text-frame.patch
2018-01-10 07:01 Fahad Note Added: 0044827
2018-01-11 04:17 Fahad Note Added: 0044830
2018-02-22 08:24 PeterBenedek Additional Information Updated
2018-02-22 08:36 PeterBenedek Category Graphics / Image Frames => Story Editor / Text Frames
2022-02-06 20:48 jghali Relationship added related to 0015153
2022-12-10 17:42 JLuc Relationship added related to 0012190