Bug Hunting Session
Bug 107405 - Setting fixed kerning (text spacing) is limited to -2pt
Summary: Setting fixed kerning (text spacing) is limited to -2pt
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.2.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
: 108785 116600 (view as bug list)
Depends on:
Blocks: Font-Rendering Character-Dialog
  Show dependency treegraph
 
Reported: 2017-04-25 05:36 UTC by Yousuf Philips (jay) (retired)
Modified: 2019-05-14 23:47 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
sample (10.61 KB, application/wps-office.docx)
2017-04-25 05:36 UTC, Yousuf Philips (jay) (retired)
Details
Word 2010 vs Writer 5.4 (46.65 KB, image/png)
2017-04-25 05:36 UTC, Yousuf Philips (jay) (retired)
Details
Bibisect log (2.91 KB, text/plain)
2018-03-24 15:16 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2017-04-25 05:36:09 UTC
Created attachment 132811 [details]
sample

Steps:
1) Open attached document
2) Select 'Condensed 3pt'
3) Context Menu > Character > Position
4) Notice that spacing is -2pt

Version: 5.4.0.0.alpha0+
Build ID: f0340e3dca1091accdb71e0c566b96cdf9e0f791
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-04-21_13:34:48
Locale: en-US (en_US.UTF-8); Calc: group
Comment 1 Yousuf Philips (jay) (retired) 2017-04-25 05:36:31 UTC
Created attachment 132812 [details]
Word 2010 vs Writer 5.4
Comment 2 Telesto 2017-04-25 17:58:38 UTC
Confirming with:
Version: 5.4.0.0.alpha0+
Build ID: a917902c48f21d04039da86048c5c36555137d7e
CPU threads: 4; OS: Windows 6.2; UI render: GL; 
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2017-04-24_23:35:22
Locale: nl-NL (nl_NL); Calc: CL

However, I'm not sure if this is an DOCX import bug. LibO doesn't allow to create a (condensed) spacing below -2,0 in any way whatsoever.
Comment 3 Yousuf Philips (jay) (retired) 2017-04-25 18:10:03 UTC
(In reply to Telesto from comment #2)
> However, I'm not sure if this is an DOCX import bug. LibO doesn't allow to
> create a (condensed) spacing below -2,0 in any way whatsoever.

Yes not allowing below -2pt is worthless if you have large text.

@Khaled: Any thoughts?
Comment 4 Yousuf Philips (jay) (retired) 2017-06-28 13:40:46 UTC
*** Bug 108785 has been marked as a duplicate of this bug. ***
Comment 5 Dieter Praas 2017-06-28 13:56:24 UTC
> However, I'm not sure if this is an DOCX import bug. LibO doesn't allow to
> create a (condensed) spacing below -2,0 in any way whatsoever.

Perhaps there are two issues, which are not exacty the same:
a) DOCX import with a spacing below -2,0pt
b) Allow a spacing below 2,0pt in LO (as proposed in bug 108785)

So I think the summary should be more precise.
Comment 6 V Stuart Foote 2017-06-28 16:47:41 UTC
*** Bug 108785 has been marked as a duplicate of this bug. ***
Comment 7 V Stuart Foote 2017-06-28 16:57:14 UTC
Issue as implemented SetFixKerning()/GetFixKerning used in SVX and edit engine.

SID_ATTR_CHAR_KERNING
and
EE_CHAR_KERNING

So affecting ALL modules.

But not clear to me where we are limiting the Xstretch negative to -2.0 (as points converted to twips) but should be able to bump that up to -100 for kerning of really large font sizes.
Comment 8 V Stuart Foote 2017-06-28 17:23:38 UTC
converting the Word 2007 OOXML (attachment 132811 [details]) to ODF with Word 2016, LibreOffice 5.3.3.2 retains the fo:letter-spacing of the MSO spacing value. Exactly same handling with import filter opening into 5.3.3.2

So it is _not_ an issue with the DOCX/OOXML import filter.

Rather, edit engine rendering to document canvas does not reduce Xspacing/Fixed Kerning below the 2.0pt value--either when rendering or as limited in the SpinBox GUI.



Snippets from the OOXML -> ODF -> .fodt

 <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Normal" style:master-page-name="MP0">
   <style:paragraph-properties style:page-number="auto" fo:break-before="page"/>
  </style:style>
  <style:style style:name="T1" style:family="text">
   <style:text-properties fo:letter-spacing="-0.0071in"/>
  </style:style>
  <style:style style:name="T2" style:family="text">
   <style:text-properties fo:letter-spacing="-0.0138in"/>
  </style:style>
  <style:style style:name="T3" style:family="text">
   <style:text-properties fo:letter-spacing="-0.028in"/>
  </style:style>
  <style:style style:name="T4" style:family="text">
   <style:text-properties fo:letter-spacing="-0.0417in"/>
  </style:style>

   <text:p text:style-name="P1">Spacing - <text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T1">Condensed 0.5pt</text:span></text:span>, <text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T2">Condensed 1pt</text:span></text:span>, <text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T3">Condensed 2pt</text:span></text:span>, <text:span text:style-name="Default_20_Paragraph_20_Font"><text:span text:style-name="T4">Condensed 3pt</text:span></text:span></text:p>
  </office:text>
Comment 9 Yousuf Philips (jay) (retired) 2017-06-30 16:38:05 UTC
(In reply to V Stuart Foote from comment #8)
> Rather, edit engine rendering to document canvas does not reduce
> Xspacing/Fixed Kerning below the 2.0pt value--either when rendering or as
> limited in the SpinBox GUI.

Yes i assumed it was an issue with the spinbox and not the importer and that was the reason why i was asking for Khaled's input in comment 3, and also didnt meta tag this bug to the DOCX meta bug. :D
Comment 10 Khaled Hosny 2017-07-01 11:58:04 UTC
(In reply to Yousuf Philips (jay) from comment #3)
> (In reply to Telesto from comment #2)
> > However, I'm not sure if this is an DOCX import bug. LibO doesn't allow to
> > create a (condensed) spacing below -2,0 in any way whatsoever.
> 
> Yes not allowing below -2pt is worthless if you have large text.
> 
> @Khaled: Any thoughts?

No idea. Such spacing is done by manipulating the DX array by the calling sites, the layout engine knows nothing about it.
Comment 11 V Stuart Foote 2018-03-24 13:52:33 UTC
*** Bug 116600 has been marked as a duplicate of this bug. ***
Comment 12 Telesto 2018-03-24 14:57:55 UTC
Quote bug 116600 comment 1

In version 4 it was named "condensed" and the limit had been relative to font-size, about 1/6.
Version: 4.5.0.0.alpha0+
Build ID: 40b1e8266e47792d354cd457c652bfb0f0a21e69
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2015-02-11_00:13:43
Locale: de_DE

In version 5.4 it is named "spacing" with negative values and shows the described problem. Version: 5.4.3.2 (x64)
Build ID: 92a7159f7e4af62137622921e809f8546db437e5
CPU threads: 8; OS: Windows 6.19; UI render: default; 
Locale: de-DE (de_DE); Calc: CL
Comment 13 Telesto 2018-03-24 15:16:13 UTC
Created attachment 140856 [details]
Bibisect log

Bisected to

author	Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>	2016-04-22 15:22:03 +0200
committer	Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>	2016-04-22 14:47:54 +0000
commit	9a745d54a5c7470180f41494283983a3b8b84a51 (patch)
tree	b5ce765cfdd1ba1faa93480aa8f3cd54c6d4e838
parent	3ae1e174014fc708833f3b43682573de1650af56 (diff)
tdf#89953 Character spacing: Allow to enter negative values
without selecting from a condensed/expanded listbox first.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=9a745d54a5c7470180f41494283983a3b8b84a51
Comment 14 V Stuart Foote 2018-03-24 15:47:12 UTC
Not clear how the .UI's <lower> -2 entry [1] is actually applied. As font size increases the reduced spacing is increased proportionally. So it is not an absolute -2 point unit. It is being scaled.

That handling needs to be understood before simply increasing the minimum value in the UI spinbox. Concern would be what happens to smaller font sizes when the negative Spacing is set larger than the font size? Will it happily just compose each glyph on top of the preceeding--or will it crash?

=-ref-=
[1] https://opengrok.libreoffice.org/xref/core/cui/uiconfig/ui/positionpage.ui?#21
Comment 15 Khaled Hosny 2018-03-24 16:44:29 UTC
Old limit was relative to font size (see code removed in the commit above), new limit is hard-coded to -1. Parts of the old code should be restored to restore the old behavior.
Comment 16 Khaled Hosny 2018-03-24 16:44:49 UTC
(In reply to Khaled Hosny from comment #15)
> Old limit was relative to font size (see code removed in the commit above),
> new limit is hard-coded to -1.

I meant -2.
Comment 17 Xisco Faulí 2018-06-05 19:35:58 UTC
Adding Cc: to Samuel Mehrbrodt