Bug 80194 - Impress: Default value for 'Raise/lower by' in Subscript not proper
Summary: Impress: Default value for 'Raise/lower by' in Subscript not proper
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.0.0 target:24.2.0
Keywords:
Depends on:
Blocks: Character
  Show dependency treegraph
 
Reported: 2014-06-18 15:44 UTC by Eliot the Cougar
Modified: 2023-10-25 11:33 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
example of the bug (34.98 KB, image/png)
2014-06-18 15:44 UTC, Eliot the Cougar
Details
Proper example of the bug (34.98 KB, image/png)
2014-06-18 15:47 UTC, Eliot the Cougar
Details
odp and odt files with subscript examples (63.47 KB, application/x-7z-compressed)
2014-07-27 13:10 UTC, Eliot the Cougar
Details
File showing the uneve3n line spacing with subscripts (27.42 KB, application/vnd.oasis.opendocument.graphics)
2019-11-27 18:23 UTC, Anastasius
Details
subscriptReport.zip: source files for the Release Notes content (285.69 KB, application/zip)
2020-03-18 15:34 UTC, Justin L
Details
How FontBasics.svg look on my system (6.43 KB, image/png)
2020-05-01 07:17 UTC, Ming Hua
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eliot the Cougar 2014-06-18 15:44:44 UTC
Created attachment 101313 [details]
example of the bug

Create new text field
Enter some text in it to make it several lines
Make some letters in this text "subscript"

Result: Uneven line spacing in the paragraph...

It has been fixed in Writer some time ago, but Impress still shows such behavior.
Comment 1 Eliot the Cougar 2014-06-18 15:45:58 UTC
Strange... Uploaded png file became (plain/text)...
Comment 2 Eliot the Cougar 2014-06-18 15:47:01 UTC
Created attachment 101314 [details]
Proper example of the bug
Comment 3 retired 2014-07-27 12:33:33 UTC
Can you please attach a zip of two test files 1) writer (fixed) 2) impress (nit fixed) so this can effectively be tested.

After providing that, please set the bug back to UNCONFIRMED. Thanks
Comment 4 Eliot the Cougar 2014-07-27 13:10:30 UTC
Created attachment 103542 [details]
odp and odt files with subscript examples
Comment 5 ign_christian 2014-07-27 15:44:37 UTC
Reproduced with LO 4.3.0.3, 4.2.6.2, 3.3.0.4 - Ubuntu 12.04 x86
AOO 4.1.0 as well

Seems the default value of "Raise/lower by" is 33%. I think it should be around 1-5% like in Writer.
Comment 6 tommy27 2016-04-16 07:25:23 UTC Comment hidden (obsolete)
Comment 7 Eliot the Cougar 2016-04-16 10:17:37 UTC
Re-tested...
Version 5.0.5.2 – the behavior is the same

Updated to 5.1.2.2 – also exactly the same

I've tested some values... To prevent uneven lines, the default value for "lower by" for subscript should be less than 10%... Like in Writer... However, Writer sets the flag "Automatic" for the value... Setting the same flag in Impress makes an issue even worse...

Subscript and superscript should never affect the distance between lines, even if they overlap with the text above or below... If that happens, it's the user's responsibility to increase the line interval...
Comment 8 QA Administrators 2017-05-22 13:26:56 UTC Comment hidden (obsolete)
Comment 9 Xisco Faulí 2017-07-13 10:19:46 UTC
Setting Assignee back to default. Please assign it back to yourself if you're
still working on this issue
Comment 10 QA Administrators 2018-07-14 02:45:19 UTC Comment hidden (obsolete)
Comment 11 Eliot the Cougar 2018-07-16 10:22:59 UTC
The bug is still present in 6.0.4.2

If you enter a lot of text in a text field, and that text contains subscripts here and there (which is common for scientific presentations), the whole text looks very ugly because of the uneven distances between lines.

Paragraph rendering should work the same way as in Writer. There is no such issue in Writer.
Comment 12 QA Administrators 2019-07-17 02:48:54 UTC Comment hidden (obsolete)
Comment 13 Eliot the Cougar 2019-07-30 09:08:29 UTC
Just checked this issue again in 6.2.5.2
The issue is still present

i.e. the gap between the line that contains subscript and the line below it is wider than normal. When there is a text with a lot of subscripts here and there (common for scientific presentations), the overall text column looks bad.
Comment 14 Justin L 2019-09-27 12:27:32 UTC
Make sure whoever looks at this focuses on SUBscripts, not SUPERscripts, which are fine. I tried to find out when "Writer fixed subscripts" but I don't see changes since 2001, and Writer already worked fine in LO 3.5 which is as far back as I can test.

There are calculations that I can't understand at all at SwSubFont::CalcEscAscent in sw/source/core/txtnode/swfont.cxx. Perhaps those can help someone.

The main point is that automatic subscripting should not drop lower than the font's descent or bottom line...
Comment 15 Justin L 2019-09-27 13:45:27 UTC
#define DFLT_ESC_SUB    -33     // also 1/3 previously 8/100
which is not clearly indicated when this happened, but I first see it in 2007 with https://cgit.freedesktop.org/libreoffice/core/commit/?id=1982c6b8ec96b793ee5461a984e2fbc40caa6342
Comment 16 hardy 2019-10-14 18:18:53 UTC
Bug 95272 seems to be a duplicate of this one here.

Can someone please try to fix this in the next 10 years? (I think I've reported this bug 10 years ago to the OpenOffice bug tracker...)

Just for the record: This behavior is still the same in the current LibreOffice version 6.3.2.2.
Comment 17 Anastasius 2019-11-27 18:23:08 UTC
Created attachment 156157 [details]
File showing the uneve3n line spacing with subscripts
Comment 18 Anastasius 2019-11-27 18:36:10 UTC
I would rate the importance as "major"
(It seems that as a "normal" user I cannot change the importance; I got an error message when trying to do so)

Reason: One cannot make a proper presentation in any case where subscripts appear in the text, such as in chemistry (chemical formulae like H2O all have subscripts).
The uneven line spacings look absolutely ugly.


With fixed line spacing (in the paragraph format dialog), superscripts are fine, but subscripts shift the whole line up. See attached file.

I do not agree with comment 5 that the default "raise/lower" should be reduced. Instead, the line spacing must not be modified when it is set to "fixed".
Comment 19 Justin L 2020-02-18 05:09:47 UTC
Proposed fixes so far:
https://gerrit.libreoffice.org/c/core/+/88910 tdf#80194 UI: revert subscript DFLT_ESC_SUB to 8% (from 33%)

https://gerrit.libreoffice.org/c/core/+/88911 tdf#80194 editeng: fix auto subscript calculations

(In reply to Anastasius from comment #18)
> With fixed line spacing (in the paragraph format dialog), superscripts are
> fine, but subscripts shift the whole line up. See attached file.

None of my fixes will be related to "fixed line spacing". If you use ridiculous values for superscript (like 400%) or set it to automatic, I think you will see that superscript is actually not fine.  It is just that the default value is appropriate.

> I do not agree with comment 5 that the default "raise/lower" should be
> reduced.
Actually, that is the key to the whole fix.  Only 20% of the font height is available for subscript-shifting while the remaining 80% is available for superscript. So subscripts need to lower a much less percentage than superscripts can or should.

Another fix needed is to set the "automatic" flag to superscript/subscript when it is set using the toolbar .uno:SubScript. However, I want to wait with that until the next release (7.1) because older versions will calculate auto very wrongly (see comment 7's note that "Setting the automatic flag in Impress makes the issue even worse...").
Comment 20 Commit Notification 2020-02-18 18:33:05 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5f4a65b7a3a29972c90a5ef4eb5fd7795b205cdf

tdf#80194 UI: revert subscript DFLT_ESC_SUB to 8% (from 33%)

It will be available in 7.0.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 21 Commit Notification 2020-02-19 19:59:48 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/94a3ac2b6f89aeac5b947034eb4d7e63838218e3

related tdf#80194 editeng RTF: set automatic subscript for \sub

It will be available in 7.0.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 22 Justin L 2020-02-25 12:13:35 UTC
(In reply to Justin L from comment #19)
> Another fix needed is to set the "automatic" flag to superscript/subscript
I tested export/import of automatic to various formats in order to test whether automatic would be problematic for compatibility. In summary, I don't think that any fixes should be necessary.

ODT, ODS, ODP, ODG: as expected, these all import and export fine.

DOC/DOCX textboxes: these do not round-trip the auto-flag, but convert actual font sizes and adjust to an appropriate escapement. No problems here.

XLS/XLSX: these do not round-trip the auto-flag. At least in Excel 2003 there is no choice for fontsize or escapement, just subscript=on/off. So it just saves/loads default values. No problems here.

PPT: this does not round-trip the auto flag, but does save escapement percentage. At least in PowerPoint 2003 there is no choice for fontsize, only escapement. And the fontsize seems to be static, no matter what escapement is chosen. Since AUTO exports default values, no problems here.

PPTX: similar to PPT except that it does round-trip AUTO, which is fine.
Comment 23 Commit Notification 2020-03-03 15:20:42 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2940d1905b921d9909b08b1e32014d3c44474ef0

tdf#80194 editeng: fix auto subscript calculations

It will be available in 7.0.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 Heiko Tietze 2020-03-12 15:32:24 UTC
Is this issue fixed, Justin?
Comment 25 Commit Notification 2020-03-13 04:34:21 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/888cff8bb0326153415b1d64d1ca6a45ac3ae84c

tdf#80194 proof search: assert to find proof of code correctness.

It will be available in 7.0.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 26 Justin L 2020-03-13 05:26:09 UTC
(In reply to Justin L from comment #19)
> Another fix needed is to set the "automatic" flag to superscript/subscript
This won't really be valuable unless LO first implements a font-metric based calculation to find the best position based on each font's specific characteristics. That would be a worthy goal (after all, that is what Writer does), worthy of a separate bug report.
Comment 27 Justin L 2020-03-18 15:34:36 UTC
Created attachment 158786 [details]
subscriptReport.zip: source files for the Release Notes content
Comment 28 Commit Notification 2020-04-03 08:05:40 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0f29d36aa9e6ac7d0914a6e1749c16ecec216904

tdf#80194 autoEsc: use fontmetrics in calculation

It will be available in 7.0.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 29 Ming Hua 2020-05-01 07:17:12 UTC
Created attachment 160173 [details]
How FontBasics.svg look on my system

(In reply to Justin L from comment #27)
> Created attachment 158786 [details]
> subscriptReport.zip: source files for the Release Notes content
Did anyone get the FontsBasics.svg file in this zip working?  Attached is a screenshot of how it looks like in Firefox on my Windows 10 system.  Other picture viewers give similar results, i.e. lots of elements missing and it doesn't look like FontBasics.png at all.

I need a proper SVG file so that I can translate it for the explanation picture ( https://wiki.documentfoundation.org/File:SubscriptReport_7.0.png ) in the release note.
Comment 30 Rizal Muttaqin 2020-05-08 04:50:35 UTC
(In reply to Justin L from comment #27)
> Created attachment 158786 [details]
> subscriptReport.zip: source files for the Release Notes content

The last paragraph contains different sentence between the file and the PNG file in the Wiki.

File:

"The calculation for determining automatic positioning was also fixed for Textboxes. Before, it used the entire 42% to both raise and lower - which was way too much. Now it uses 80% and 20% respectively."

Wiki:

"The calculation for determining automatic positioning was also fixed for Textboxes. Before, it used the entire 42% to both raise and lower - which was way too much. Now, just like the Writer, it uses the font's real ascent and descent to calculate optimal position."


Which one the right sentence?

*and why on earth this should be a DOC file. :(
Comment 31 Justin L 2020-05-08 05:15:18 UTC
(In reply to Rizal Muttaqin from comment #30)
> Which one is the right sentence?
The one on the dynamic wiki is the up-to-date sentence. The one in the static upload to bugzilla is the obsolete one.

(The end result is basically the same thing, so I'm not too worried about any documentation errors. This changed is documented in the summary of https://wiki.documentfoundation.org/File:SubscriptReport_7.0.png, but of course that is hard to find/notice.)
Comment 32 Gizze 2021-03-30 15:04:51 UTC
I was surprised to see a formatting change in my impress slide sets when I upgraded to 7.0.0.
My index relative font size is 80% and I manually lowered indices by 20%. 
As of 7.0.0 the automatic lowering by 8% was set everywhere. This is not good for symbols like, e.g. n_0, where a relatively large letter is the index of a relatively small one.
I see that there has been a long dispute on this bug. Maybe it would be better not to enable Automatic raise/lower by default. The old settings were still there and I could re-activate them by switching off Automatic.
I luckily had an old macro in my backup to fix all the indices.
Is there a way to turn of automatic raise/lower by default, maybe somewhere in the settings?
Comment 33 Justin L 2021-03-30 15:48:32 UTC
(In reply to Gizze from comment #32)
> My index relative font size is 80% and I manually lowered indices by 20%. 
> As of 7.0.0 the automatic lowering by 8% was set everywhere.
I would not expect that a document that saved as non-automatic would import as automatic. Please create a new bug report and attach a simple, sample document.
Comment 34 Commit Notification 2023-06-12 07:31:31 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

related tdf#80194 SvxEscapementItem: set auto flag as default

It will be available in 24.2.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.