Bug 142317 - FORMATTING: Handling of non-default-size subscript in automatic mode
Summary: FORMATTING: Handling of non-default-size subscript in automatic mode
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.2.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2021-05-16 17:16 UTC by Gizze
Modified: 2021-05-19 11:31 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Demo file with sample indices (46.68 KB, application/vnd.oasis.opendocument.presentation)
2021-05-16 17:16 UTC, Gizze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gizze 2021-05-16 17:16:57 UTC
Created attachment 172060 [details]
Demo file with sample indices

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 attach a sample file where N_C and N_V demonstrate the index problem.
Comment 1 Justin L 2021-05-17 08:34:06 UTC
Used bibisect-linux-64-7.0 to confirm this started in 7.0 with
author	Justin Luth  on 2020-03-03 16:20:03 +0100
commit	2940d1905b921d9909b08b1e32014d3c44474ef0
    tdf#80194 editeng: fix auto subscript calculations

(In reply to Gizze from comment #0)
> My index relative font size is 80% and I manually lowered indices by 20%. 
As soon as you turn on automatic, the 20% that you see in "raise/lower by" means nothing. So with automatic you are actually lowering by 4% in 7.0.  In earlier versions the automatic setting actually lowering by 20% (the same as what you thought). So in your case it just happened to work out nicely (100-80 = 20%) where the completely default situation was terrible. (100-58 = 42%).

If you used letters with a descender (like a g, p or q) then your 80%/20% ratio would look bad and intrude on the line below. So I don't think there are any problems with my patches or formulas - you just happened to be using a combination of characters and sizes that previously worked identically when using automatic or not automatic.

Using Word 2016 Powerpoint, there is no choice for relative font size, so it only allows 58%. The suggested raise/lower is 25% (while Impress suggests 8%). This is quite different from Word, where you have no choice at all, but just a check-box for subscript (or something which offsets by points, not a percentage).

Compared to Writer, automatic-at-80% in Impress is acting very similarly to automatic-at-80% in Writer.

So in conclusion, I don't think there is anything particularly wrong with automatic in this case. By definition, automatic means leaving it up to the computer to do the formatting. (A minor reduction of fontsize doesn't leave much extra space for lowering. Using all defaults of 58%/8% looks pretty good IMHO.) Automatic also needs to deal with characters that have descenders, and the current code handles them properly.

OP can still set 80%/20% and get the results that he wants when automatic is turned off - and default SHOULD be turned off in this case because the intention is to lower the character below what is "safe" (but in this case is safe since the characters don't have any descenders).

As noted in bug 80194 comment 32, it might be desirable to NOT automatically turn on "automatic", but allow the previously used state to be remembered - just like it remembers the last used relative font size, and raise/lower by.
Comment 2 Justin L 2021-05-17 11:48:53 UTC
P.S. This kind of response/bug report was not unexpected.
https://cgit.freedesktop.org/libreoffice/core/commit/?id=2940d1905b921d9909b08b1e32014d3c44474ef0

    THIS WILL CHANGE THE POSITION OF EDITENG SUBSCRIPTS
    AND SUPERSCRIPTS IN EXISTING DOCUMENTS!
    That is because they were very poorly placed
    before - using a formula that is very different
    from how Writer does it. Everyone in the bug reports
    indicates that Writer does it good, but Impress
    does it really bad. (tdf#89849, tdf#63083).
Comment 3 Justin L 2021-05-18 11:22:18 UTC
(In reply to Justin L from comment #1)
> As noted in bug 80194 comment 32, it might be desirable to NOT automatically
> turn on "automatic", but allow the previously used state to be remembered -
> just like it remembers the last used relative font size, and raise/lower by.
I double-checked how this works. It seems to work fairly well. Turning "automatic" on or off does not affect the remembered raise/lower by setting - so that is good.  This has been true as far back as I can check - already in LO 3.5.

It sounds like OP's process is to turn on subscript via Format - Character - Position - Subscript. [That is the right process - good.] It is only one more click to turn off automatic mode, and then he has the desired settings.

I think leaving things this way is the best. For interoperability with other formats, automatic mode is the best mode, so its use should be highly encouraged. Automatic mode also works better in case of font substitution (at least in theory). And only one extra click in the same dialog box isn't too much to ask for a user who has a very particular setting he wants to use.

[When automatic mode is enabled, the greyed-out raised/lowered might be a bit misleading since it shows the last-used (or default) percentage, and not the percentage that automatic is actually applying. Proposed patch at
https://gerrit.libreoffice.org/c/core/+/115739 helps a bit.]
Comment 4 Gizze 2021-05-19 10:51:02 UTC
> It sounds like OP's process is to turn on subscript via Format - Character -
> Position - Subscript. [That is the right process - good.]
This is how I do it.

> It is only one
> more click to turn off automatic mode, and then he has the desired settings.
This is perfectly fine when formatting a new index.

I have no doubt that the new formatting algorithm makes a lot of sense.
 
My problem is that I manually formatted hundreds of indices in my slides in earlier versions of Impress. To do so I turned automatic formatting off as outlined above, I guess. That is fine.
I don't remember exactly: Was it possible to enter custom proportions while leaving automatic formatting turned on? I must have turned automatic off, right?

After the migration to LO 7.0 the indices looked different. I conclude that the automatic formatting option was turned on again (why?). Now I need to go through all my slides to get the previous formatting back.
Comment 5 Justin L 2021-05-19 11:29:32 UTC
(In reply to Gizze from comment #4)
> I don't remember exactly: Was it possible to enter custom proportions while
> leaving automatic formatting turned on? I must have turned automatic on,
> right?
Yes, I think you just left automatic on (since at that time it luckily didn't hurt).
 
> After the migration to LO 7.0 the indices looked different. I conclude that
> the automatic formatting option was turned on again (why?).
I opened your sample document in LO 3.5, and Automatic is enabled for both NC and NV. There is nothing in the code changes that should attempt to turn on automatic.

Thanks for the feedback, and for the nudge to improve the information displayed to the user. I'll mark this as FIXED (for 7.2) because of that minor change.
Comment 6 Commit Notification 2021-05-19 11:31:02 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#142317 chardlg UI: show approx auto-esc % based on EscProp

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