Download it now!
Bug 89849 - Unify superscript and subscript behaviour between apps
Summary: Unify superscript and subscript behaviour between apps
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.0.0
Keywords: bibisected, bisected, needsDevEval, regression, topicUI
Depends on:
Blocks: Unify-Across-Apps
  Show dependency treegraph
 
Reported: 2015-03-05 16:34 UTC by Jonathan Underwood
Modified: 2020-03-11 20:49 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Screencast showing superscript problem in libreoffice (4.93 MB, video/webm)
2015-06-18 15:11 UTC, Jonathan Underwood
Details
Different font positions in Writer (63.78 KB, image/png)
2015-06-19 09:37 UTC, Heiko Tietze
Details
Different font positions in Impress (47.24 KB, image/png)
2015-06-19 09:39 UTC, Heiko Tietze
Details
Test cases for font pos (34.04 KB, application/zip)
2015-06-19 09:41 UTC, Heiko Tietze
Details
Overview image of LibreOffice Impress, Writer, and Powerpoint superscript handling (22.79 KB, image/png)
2018-06-27 12:50 UTC, Alex Heuer
Details
tdf89849_misplacedSuperscripts.odp: bad looking superscript in title, but OK in text. (18.15 KB, application/vnd.oasis.opendocument.presentation)
2020-02-20 11:39 UTC, Justin L
Details
tdf89849_AutoFitEscapement_small.odg (10.72 KB, application/vnd.oasis.opendocument.graphics)
2020-02-21 14:42 UTC, Justin L
Details
tdf89849_exaggeratedSuperscripts.odp: demo of how the fix will affect existing presentations (18.41 KB, application/vnd.oasis.opendocument.presentation)
2020-03-11 20:10 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Underwood 2015-03-05 16:34:17 UTC
In Impress, there is presently no way to specify the default size and position for subscript and superscript text. Worse, the default position for superscript text is braindead - raise by 33% puts the superscript text vertically about in the middle of the preceeding text.
Comment 1 Joel Madero 2015-03-06 03:58:22 UTC
Outside of there being useless extra language ("superscript text is braindead" literally adds nothing at all to the bug - in the future please stick to the issue without the extra language)

This is a fine enhancement request. Marking as such.

It seems like this applies to all of LibreOffice so changing component.
Comment 2 Jonathan Underwood 2015-03-06 10:36:10 UTC
Apologies for the language - reading back I can see it might cause offence. I'll try to do better in future.

However, I do wonder what's going on with the superscript height:

1) In Writer, if I insert a superscript character using C-S-p then go to Format->Character->Position the Raise/Lower percentage is greyed out and Automatic is selected. The greyed out value is 33%. On unclicking Automatic, the value immediately jumps to 66%. 66% is a reasonably sensible default of course.

2) In Impress, doing the same exercise, the greyed out value is 33%, and remains 33%.

So, my guess is somewhere in the code, there's a bogus 33% setting, and it's been worked around in Writer, but not in Impress. While it would be nice for there to be a way to set and save a different position, in the shorter term, it would be nice if this bug with the default position could be addressed for Impress.
Comment 3 Joel Madero 2015-03-06 14:32:28 UTC
Hey Jonathan -

Ah I think I may have misunderstood the issue then. Is there any way that you can jump into the QA channel and explain it to one of our QA members - kind of walk them through it and make sure they can reproduce. 

http://webchat.freenode.net/?channels=libreoffice-qa

I don't see the value change from 33% to 66% in writer. It sticks with 33% in both Writer and Presentation.
Comment 4 Joel Madero 2015-03-06 15:25:37 UTC
Jonathan - 

Multiple people cannot confirm this issue but as a workaround you could easily create a style that does the job.

1. F11
2. Click on "character style" icon;
3. Create a new one (right click in empty space)
4. Set your character style however you want.

Now whenever you want to create a new subscript - just highlight the text and click on that style, it'll put it where you want it :)
Comment 5 Buovjaga 2015-03-06 16:04:59 UTC
Followed instructions in comment 2, but could not reproduce the 66% jump (even in 4.2). Are you sure you haven't applied 66% before and it's just remembering it?

For the defaults there are some workarounds. They unfortunately only work in Writer, not in Impress. Impress doesn't have character styles or regular expressions for find & replace.

If you want to apply your settings for sub- and superscript as you write, you can use character styles with keyboard shortcuts assigned to them. It is certainly a bit tedious as you have to select your characters to apply the style (shift-left arrow may be the fastest).

Perhaps the most convenient workaround is to change the position of many sub-/superscripts at once.

If you've left the positions to "Automatic", open the Find & replace dialog.
Search for .+
Expand other options.
Enable Regular expressions.
While being in the Search for field, click Format...
Select Position - Sub-/Superscript (automatic), click ok.
Enable Include styles.
In the Replace with field, input &
Use Format for the Replace with field, too and select the Sub-/superscript settings you want.

If you mess up the format selections in the Find & replace dialog fields, reset them with No format.

Tested with:

Win 7 Pro 64-bit, LibO Version: 4.4.1.2
Build ID: 45e2de17089c24a1fa810c8f975a7171ba4cd432
Locale: fi_FI

Ubuntu 14.10 64-bit
Version: 4.4.1.2
Build ID: 40m0(Build:2)
Locale: en_US

Version: 4.2.0.4
Build ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71
Comment 6 Jonathan Underwood 2015-06-18 15:11:28 UTC
Created attachment 116627 [details]
Screencast showing superscript problem in libreoffice
Comment 7 Jonathan Underwood 2015-06-18 15:11:53 UTC
OK, sorry for not responding sooner, but I had to get a presentation finished, and since this issue got in the way I switched to other software to get the job done. Now I have some time to get back to it.

Now, As far as I can tell from the comments #3 #4 and #5, you all seem to think that 33% is a suitable default? I have to disagree with that, as it places the text too low.

I have now upgraded to Fedora 22, which ships with Version: 4.4.3.2. I deleted my libreoffice profile and started from a clean state, and still the default is 33% height for superscript. You can see in the screencast I have attached how the problem manifests.
Comment 8 Buovjaga 2015-06-18 16:09:34 UTC
Adjusted summary due to changed objective.
Comment 9 Joel Madero 2015-06-19 06:14:34 UTC
I'd prefer to have UX decide on this default - I've never once thought that the current placement is bad - you obviously disagree. The deciders in these cases (where it's just a matter of default preference) is UX. 

If UX thinks that it should be done - assign the bug to me and I'll commit a patch hopefully this weekend.
Comment 10 Heiko Tietze 2015-06-19 09:37:18 UTC
Created attachment 116643 [details]
Different font positions in Writer

Defaults should be the same over all apps, so I tried with Writer. And the drawback of having a larger sub/superscript is a destroyed type face. Probably the default is not 33% since just this number leads to a larger line spacing.
Comment 11 Heiko Tietze 2015-06-19 09:39:25 UTC
Created attachment 116644 [details]
Different font positions in Impress

If the same text is copied to Impress it looks completely different. I'd say it's a bug. (BTW: copy/paste didn't handle the position well)

Both images done with DejaVu Sans, Build ID: 4.4.3.2 Arch Linux build-2.
Comment 12 Heiko Tietze 2015-06-19 09:41:36 UTC
Created attachment 116645 [details]
Test cases for font pos

Writer and Impress test cases
Comment 13 Buovjaga 2015-09-12 13:00:11 UTC
*** Bug 93709 has been marked as a duplicate of this bug. ***
Comment 14 Uwe Dippel 2015-09-12 14:14:50 UTC
Mine (bug 93709) has been marked as duplicate. 
Oh well, I can't see why, but as we read above, 'mind your language'.

My report actually was not so much about the defaults as about the fact, that there is no way to create a character style icon any longer in 5.X. And the general style layout doesn't have the 'position' tab that pops up with direct formatting. So no way (as far as I can see) to change it, except by manual formatting. 

As someone using this feature frequently (engineering) I can understand both sides of the discussion on the 58%. Why? I can't pinpoint the circumstances, but sometimes the 58% looks really great, and sometimes the 58% just makes the superscript pop up at about the middle of the preceding text, and exactly like the original reporter stated. 
I could show you screenshots of both outcomes, and prove that they have the same settings. But that won't help. In future I have a closer look, since I am aware of the unforeseeable outcome of the default 'superscript'. (Could it depend on the font?)
Comment 15 Joel Madero 2015-09-12 14:54:34 UTC
Per last comment I'm going to remove the duplicate mark. Thanks for being cool about it :)
Comment 16 Uwe Dippel 2015-09-12 15:28:06 UTC
(In reply to Joel Madero from comment #9)
> I'd prefer to have UX decide on this default - I've never once thought that
> the current placement is bad - you obviously disagree. The deciders in these
> cases (where it's just a matter of default preference) is UX. 
> 
> If UX thinks that it should be done - assign the bug to me and I'll commit a
> patch hopefully this weekend.

I agree, and I don't.
See my comment further down, or just look yourself at the fabulous work of Jonathan. For anyone with a sense of math, in his screencast the superscript *looks*, please, *looks* braindead. 
Nowhere else in the world or in any other presentation software (no, I'm not talking about some so-called 'PP') does superscript, or an x-square look like this; and not only with Jonathan, it (sometimes) does with me, too. 

If you please check yourself, you'll see that this is not a question for UX. I am sure, that the people in UX are *not* [you know what ... ;-) ], and will want a 'square' as superscript, not centered but with reduced size.
Comment 17 David Kremer 2016-03-10 21:11:36 UTC
I didn't have time to read all the comment, but it seems that I encounter the same issue (impress 5.1.0.3)

Screenshot attached
Comment 19 Yousuf Philips (jay) (retired) 2016-03-11 10:40:43 UTC
Simple solution is to have the superscript command (.uno:SuperScript) do what it does in Writer, set it to automatic, and once that is done, it looks fine. Bad news is that the subscript command (.uno:SubScript) with automatic enabled doesnt act similar to Writer.

So what we need is that the behaviour is the same in all apps and Writer is the basis of what the behaviour should be like.
Comment 20 Alex Heuer 2018-06-27 12:50:26 UTC
Created attachment 143158 [details]
Overview image of LibreOffice Impress, Writer, and Powerpoint superscript handling

This bug is still there in LO 6.0.5.2. I have attached an image comparing LibreOffice Impress, Writer, and Powerpoint. One can immediately see, that the default superscript setting puts the superscript way too low. As others have mentioned this is not a matter of design choice or popular oppinion. The way it is handled at the moment is just plain wrong. I am a physicist and I can not use this software for anything if I have to manually adjust every superscript position because otherwise the information conveyed can be easily misinterpreted. 

At the very least there needs to be a setting to change the default in Impress. While it is possible to adjust a layout in Writer (which does not suffer from this problem) this feature is not available in Impress. An even better way would be to not just provide a changeable default setting but also set a more reasonable default from the get go. The positioning in Writer is completely satisfactory.
Comment 21 Justin L 2020-02-19 18:40:17 UTC
Assuming that the relative fontsize remains at the default of 58%, raising by 33% should be mathematically perfect (slightly dependent on the font used). A higher value will cut into the preceding line - creating a larger gap.  (subscript example: attachment 101314 [details])

After watching the screencast from comment 6, I expect there are layout or other bugs happening here. I get inconsistent results when I test this (same as comment 14)...

(In reply to Jonathan Underwood from comment #2)
> On unclicking Automatic, the value immediately jumps to 66%.
Comment 5 is correct. Format-character REMEMBERS the last settings that YOU ENTERED into that field. That is why nobody could replicate your 66%. On a clean user profile, Format-Character will use DFLT_ESC_SUPER which is 33%.

(In reply to Heiko Tietze from comment #10)
> Probably the default is not 33% since just this number leads to a larger
> line spacing.
Your 33% example was a subscript, not a superscript. "Automatic" calculates 8% for a subscript - but it is 33% for a superscript. I changed DFLT_ESC_SUB back to 8% for LO 7.0.  (see bug 80194)

"Automatic" had terrible calculations in editeng (Draw/Impress/Writer textboxes), especially for subscripts. (again, see bug 80194).

(In reply to Yousuf Philips (jay) (retired) from comment #19)
> Simple solution is to have the superscript command (.uno:SuperScript) do
> what it does in Writer, set it to automatic, and once that is done, it looks
> fine. Bad news is that the subscript command (.uno:SubScript) with automatic
> enabled doesn't act similar to Writer.
Hopefully with bug 80194's fixes automatic now SHOULD look fine. For a patch to set automatic with .uno::SupserScript, see https://gerrit.libreoffice.org/c/core/+/88998/1
Comment 22 Justin L 2020-02-20 11:39:23 UTC
Created attachment 158036 [details]
tdf89849_misplacedSuperscripts.odp: bad looking superscript in title, but OK in text.

(In reply to Justin L from comment #21)
> I expect there are layout or other bugs happening here.
Steps to reproduce:
1-start a new presentation based on the DNA template.
2-In the TITLE, enter X4x4 and make the 4's superscripts (it doesn't matter if they are auto or not). Notice that the 4 is not raised up very much.
3a-Format menu - Objects and Shapes - Text: set "Fit Width to Text".  Notice that the superscript is now properly placed.
or 3b- change the master template to "piano" or "pencil". Notice that the superscript is now properly placed.

My guess is that there is some remnant of "fit to frame" in these templates - based on a hint I saw in LO 4.1.
Comment 23 Justin L 2020-02-20 12:20:00 UTC
(In reply to Justin L from comment #22)
> My guess is that there is some remnant of "fit to frame" in these templates
> - based on a hint I saw in LO 4.1.

Yup: removing draw:fit-to-size="shrink-to-fit" style:shrink-to-fit="true" fixes it.
Comment 24 Justin L 2020-02-20 12:55:23 UTC
(In reply to Heiko Tietze from comment #11)
> If the same text is copied to Impress it looks completely different. I'd say
> it's a bug.
Same problem. If you right-click on the textbox and turn off "Autofit Text", then it looks nearly identical to Writer (except for the problematic automatic one).
Comment 25 Justin L 2020-02-21 14:40:29 UTC
So this has always been poor, but the specific issue of a 33% superscript showing up in the middle of the line started in LO 4.1 with
commit 804f47a893359baa0b72f1a72df3d79302225654
    Author:     Jan Holesovsky
    CommitDate: Mon Feb 25 15:08:05 2013 +0100
        fdo#55931, fdo#57956: Fix both autofit and stretched width.
    
        This rewrites commit fa694a21b806ed7837c1337ec49a4b299c478393 (fix of
        tdf#55931), and fixes it a better way.

Proposed fix at https://gerrit.libreoffice.org/c/core/+/89214
Comment 26 Justin L 2020-02-21 14:42:06 UTC
Created attachment 158079 [details]
tdf89849_AutoFitEscapement_small.odg
Comment 27 Commit Notification 2020-03-11 19:29:24 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#89849 editeng: adjust escapement before resetting Propr

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 28 Justin L 2020-03-11 19:42:54 UTC
Between this bug report and bug 80194, I think the complaints in this report are solved.
1.) Defaults for subscript are sane - at 8%
2.) Automatic sizing is fixed for Textboxes, much closer to Writer's algorithm
3.) The "autofit text" misplacement of superscripts - which was the focus of most of this bug report.

So marking as resolved (for LO 7.0). Please alert me if there is something in this report that hasn't been addressed yet.
Comment 29 Justin L 2020-03-11 20:10:10 UTC
Created attachment 158623 [details]
tdf89849_exaggeratedSuperscripts.odp: demo of how the fix will affect existing presentations