Bug 137272 - Make it less likely that user unwillingly loses footnote and endnote font size inheritance from paragraph
Summary: Make it less likely that user unwillingly loses footnote and endnote font siz...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.1.2 release
Hardware: All All
: low enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Footnote-Endnote-Properties
  Show dependency treegraph
 
Reported: 2020-10-05 18:49 UTC by TH
Modified: 2023-12-22 16:42 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot of what I understand to be the issue (84.12 KB, image/png)
2023-10-13 09:06 UTC, Stéphane Guillou (stragu)
Details
Sample document (31.88 KB, application/vnd.oasis.opendocument.text)
2023-11-08 09:36 UTC, Heiko Tietze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description TH 2020-10-05 18:49:31 UTC
Description:
Superscripted font is cut off and line spacing increased when smaller block quoted text has footnote or endnote in it, due to use of one font size for all footnotes in document.

While I realize this may be caused by a limitation of the .odt format itself, given that it may not support saving different anchor text font sizes for footnotes against different main document text sizes, there IS a way to program a workaround, and that should be done.  Simply look at the size of the surrounding text (to the anchor text of the footnote) and if that surrounding text is a smaller point size than the default text (e.g., of a document's main body), then calculate the size and position of the superscript for the anchor text (i.e., footnote or endnote indicator) to be proportionally smaller.

For example, if my main document text, in the Default style, is 11 points, and that is the size used as the basis for calculating the footnote anchor text size and position when it is superscripted in the main document, things are fine.  But as soon as my main document has a block quote of text that is say 9 points in its style, then when I place a footnote in that block quote or at the end of it, LibreOffice 7.x calculates the size of the anchor text for that note based upon the 11 point size of the anchor text style, and NOT based upon the proper 9 point size of the actual document text being footnoted.  Consequently, the size of the anchor text in or at the end of the block quote ends up being TOO LARGE and its position TOO HIGH, so that a) the top of the anchor text-styled note number may be cut off AND the line spacing of the block quote line containing the footnote is thrown off and made too large, messing up the appearance of the document.  That looks very poor and can be rectified with slightly better programming that takes into account the point size of surrounding document text (e.g., 9 points instead of the default 11 points).

The above has been a problem with Apache OpenOffice and LibreOffice from the start, and has been a carried-over issue from the IBM Lotus Symphony days as well.  Given the LibreOffice strives to be a more polished product and even compete to an extent against paid suites (e.g., Microsoft Office) this SHOULD and CAN be fixed, regardless of any possible .odt file format limitation.

Steps to Reproduce:
1. Create a document with a default text size of 11, for example.  Create a paragraph using that default.  Set the anchor text style for footnotes to use the same font at the same 11 point size, as its basis for calculating the superscript size and position of the note anchor text
2. Create a block quote with the same font but using a 9 point text size, and place a paragraph of text in the document using that block quote.  Then place a footnote in or at the end of that block quote.
3. Having done step 2, you will notice that the line of text in the block quote containing the footnote anchor text is a) misaligned with line spacing that is too large for the block quote (e.g., when the latter is single spaced text) and b) the footnote anchor text (e.g., "1" for the first footnote) will likely be cut off at the top, showing only a portion of the "1", and that is because the size of the anchor text and its superscripted placement are both being calculated on the basis of the anchor text style for footnotes using an 11 point text size rather than the 9 point text size of the surrounding document.

Actual Results:
The footnote (or endnote if that's what's used) anchor text is too large and cut off at the top when the footnote (or endnote) is placed in or at the end of the block quote in the document.

Expected Results:
The anchor text for the footnote in the smaller-point block quote (which is 9 points rather than the 11 points of the default style) should be smaller and a bit lower than corresponding anchor text for a footnote placed in the text based upon the default style having an 11 point size.  In other words, even a note anchor placed in a block quote having a somewhat smaller point size than the point size of the main document's text should NOT be cut off or cause the line of text in which it's placed to have line spacing that is too large and obviously different from the rest of the lines in the block quote.


Reproducible: Always


User Profile Reset: No



Additional Info:
No other information.
Comment 1 TH 2020-10-11 17:43:12 UTC
I sure would like to see some responses to, and movement on this easily reproduced superscripted anchor issue in LibreOffice!  Anyone, please?
Comment 2 Heiko Tietze 2020-10-26 09:42:13 UTC
Please add a sample document and maybe also a screenshot. IIRC, the calculation of footnotes has been changed recently, so testing with a recent version might also good.
Comment 3 TH 2020-10-27 22:56:01 UTC
So, I went to create a sample document showing this issue, and in the process, discovered the cause—and how you may easily reproduce it.

If one does as I originally outlined, BUT ALSO has specified a point size for the font in the Footnote Anchor (or Endnote Anchor) character style, then the issue occurs!  While it IS necessary to be able to change the font face in the footnote or endnote anchor character style, as we can now, there is NO reason to also allow one to set the font's point size in that SAME style, as doing so overrides the normal behavior, and actually causes the issue I reported.

Therefore, I recommend either disabling the ability to specify the point size for the specified font in the Footnote Anchor and Endnote Anchor character styles (and only in those styles), or giving the user some warning that applying a specified point size to the font in those anchor style may cause improper appearance of the text.

Bottom line: not specifying, if one has then removing the specification of, the point size for the employed font in the Footnote Anchor character style solved my issue.
Comment 4 Heiko Tietze 2020-11-10 12:49:37 UTC
Justin, you changed the calculation of super/subscript recently. What's your thoughts here?
Comment 5 Justin L 2020-11-10 13:30:44 UTC
(In reply to Heiko Tietze from comment #4)
> Justin, you changed the calculation of super/subscript recently. What's your
> thoughts here?

I'd say that when styles are used properly, then it sounds like there is no problem. But when you change the style, it obviously will affect everything that uses that style. (And I don't see any point in having a pop-up that warns the user that his changes to a footnote style will affect footnotes.) I read through this report a week ago and didn't see anything worth commenting on.

Since there is no example document attached, I didn't bother to try to completely understand or reproduce the problem for myself.
Comment 6 Heiko Tietze 2020-11-11 09:05:33 UTC
Taking Justin's comment to resolve the ticket as NAB. If you have further information, TH, please reopen and go into details.
Comment 7 TH 2020-11-11 22:49:22 UTC
(In reply to Justin L from comment #5)
> (In reply to Heiko Tietze from comment #4)
> > Justin, you changed the calculation of super/subscript recently. What's your
> > thoughts here?
> 
> I'd say that when styles are used properly, then it sounds like there is no
> problem. But when you change the style, it obviously will affect everything
> that uses that style. (And I don't see any point in having a pop-up that
> warns the user that his changes to a footnote style will affect footnotes.)
> I read through this report a week ago and didn't see anything worth
> commenting on.
> 
> Since there is no example document attached, I didn't bother to try to
> completely understand or reproduce the problem for myself.

I do an enormous amount of technical, heavily-documented writing.  You may not see any point to the pop-up warning request, but to me, you are just being arrogant with such an observation.  There is definitely a need for such a pop-up, or the ability to specify the point size for the font should be removed in the situation I've described.  That would all make LibreOffice Writer both friendlier and more reliable, while helping to avert what can be a difficult to resolve situation on its face.
Comment 8 Xisco Faulí 2020-11-30 12:51:41 UTC
(In reply to Heiko Tietze from comment #2)
> Please add a sample document and maybe also a screenshot. IIRC, the
> calculation of footnotes has been changed recently, so testing with a recent
> version might also good.

Sample document is still missing. This makes it easier for us to verify the bug. 
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
(Please note that the attachment will be public, remove any sensitive information before attaching it. 
See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
Comment 9 QA Administrators 2021-09-24 04:07:12 UTC Comment hidden (obsolete)
Comment 10 TH 2021-10-13 17:44:33 UTC
The steps required to reproduce this bug ARE BELOW, as provided on October 5, 2020 (see the post).
Comment 11 TH 2021-10-13 17:47:17 UTC
From my October 27, 2020 post as well:

So, I went to create a sample document showing this issue, and in the process, discovered the cause—and how you may easily reproduce it.

If one does as I originally outlined [(on October 5, 2020)], BUT ALSO has specified a point size for the font in the Footnote Anchor (or Endnote Anchor) character style, then the issue occurs!  While it IS necessary to be able to change the font face in the footnote or endnote anchor character style, as we can now, there is NO reason to also allow one to set the font's point size in that SAME style, as doing so overrides the normal behavior, and actually causes the issue I reported.

Therefore, I recommend either disabling the ability to specify the point size for the specified font in the Footnote Anchor and Endnote Anchor character styles (and only in those styles), or giving the user some warning that applying a specified point size to the font in those anchor style may cause improper appearance of the text.

Bottom line: not specifying, if one has then removing the specification of, the point size for the employed font in the Footnote Anchor character style solved my issue.
Comment 12 Buovjaga 2022-10-19 10:29:51 UTC
Still no example document provided and I don't understand how to do step 2, so setting back to needinfo.
Comment 13 QA Administrators 2023-04-18 03:23:32 UTC Comment hidden (obsolete)
Comment 14 QA Administrators 2023-05-19 03:17:22 UTC Comment hidden (obsolete)
Comment 15 TH 2023-05-31 23:45:42 UTC
For anyone actually reading carefully and paying close attention, there IS sufficient information in my original description (below) to CONFIRM the bug!  Don't be lazy.
Comment 16 TH 2023-05-31 23:47:59 UTC
OS: Windows 10 Pro
All versions of LibreOffice through the latest one


Description:
Superscripted font is cut off and line spacing increased when smaller block quoted text has footnote or endnote in it, due to use of one font size for all footnotes in document.

While I realize this may be caused by a limitation of the .odt format itself, given that it may not support saving different anchor text font sizes for footnotes against different main document text sizes, there IS a way to program a workaround, and that should be done.  Simply look at the size of the surrounding text (to the anchor text of the footnote) and if that surrounding text is a smaller point size than the default text (e.g., of a document's main body), then calculate the size and position of the superscript for the anchor text (i.e., footnote or endnote indicator) to be proportionally smaller.

For example, if my main document text, in the Default style, is 11 points, and that is the size used as the basis for calculating the footnote anchor text size and position when it is superscripted in the main document, things are fine.  But as soon as my main document has a block quote of text that is say 9 points in its style, then when I place a footnote in that block quote or at the end of it, LibreOffice 7.x calculates the size of the anchor text for that note based upon the 11 point size of the anchor text style, and NOT based upon the proper 9 point size of the actual document text being footnoted.  Consequently, the size of the anchor text in or at the end of the block quote ends up being TOO LARGE and its position TOO HIGH, so that a) the top of the anchor text-styled note number may be cut off AND the line spacing of the block quote line containing the footnote is thrown off and made too large, messing up the appearance of the document.  That looks very poor and can be rectified with slightly better programming that takes into account the point size of surrounding document text (e.g., 9 points instead of the default 11 points).

The above has been a problem with Apache OpenOffice and LibreOffice from the start, and has been a carried-over issue from the IBM Lotus Symphony days as well.  Given the LibreOffice strives to be a more polished product and even compete to an extent against paid suites (e.g., Microsoft Office) this SHOULD and CAN be fixed, regardless of any possible .odt file format limitation.

STEPS TO REPRODUCE (PAY ATTENTION):
1. Create a document with a default text size of 11, for example.  Create a paragraph using that default.  Set the anchor text style for footnotes to use the same font at the same 11 point size, as its basis for calculating the superscript size and position of the note anchor text
2. Create a block quote with the same font but using a 9 point text size, and place a paragraph of text in the document using that block quote.  Then place a footnote in or at the end of that block quote.
3. Having done step 2, you will notice that the line of text in the block quote containing the footnote anchor text is a) misaligned with line spacing that is too large for the block quote (e.g., when the latter is single spaced text) and b) the footnote anchor text (e.g., "1" for the first footnote) will likely be cut off at the top, showing only a portion of the "1", and that is because the size of the anchor text and its superscripted placement are both being calculated on the basis of the anchor text style for footnotes using an 11 point text size rather than the 9 point text size of the surrounding document.

Actual Results:
The footnote (or endnote if that's what's used) anchor text is too large and cut off at the top when the footnote (or endnote) is placed in or at the end of the block quote in the document.

Expected Results:
The anchor text for the footnote in the smaller-point block quote (which is 9 points rather than the 11 points of the default style) should be smaller and a bit lower than corresponding anchor text for a footnote placed in the text based upon the default style having an 11 point size.  In other words, even a note anchor placed in a block quote having a somewhat smaller point size than the point size of the main document's text should NOT be cut off or cause the line of text in which it's placed to have line spacing that is too large and obviously different from the rest of the lines in the block quote.


Reproducible: Always
Comment 17 Telesto 2023-06-01 02:07:31 UTC
@TH
(In reply to Buovjaga from comment #12)
> I don't understand how to do step 2, so setting back to needinfo.

Would you mind to attach a sample document where the steps in comment 0/ comment 16 are applied (so we can open the document and see the - broken - end result)

The steps are apparently less obvious
Comment 18 Stéphane Guillou (stragu) 2023-10-13 09:06:28 UTC
Created attachment 190187 [details]
screenshot of what I understand to be the issue

Is this the issue you describe? Same footnote anchor style used when inserted in different paragraphs with different styles, resulting in line spacing issue and anchor font looking e.g. too big?
Comment 19 ajlittoz 2023-10-15 13:20:39 UTC
I don't see any problem IFF user modifying the character style leaves font size in TRANSPARENT STATE so that font size is inherited from the environment. You can change font face without changing font size, but DON'T EVER click on or otherwise play with font size.

Any interaction will SET the size. Unfortunately, present UI doesn't report transparent state for attributes, i.e. the fact that the effective value is inherited from ancestor styles.

Since OP didn't provide a sample file, we can't check if this is only a problem of unwanted attribute override when configuring the cgaracter style.
Comment 20 TH 2023-11-07 02:53:06 UTC
(In reply to Stéphane Guillou (stragu) from comment #18)
> Created attachment 190187 [details]
> screenshot of what I understand to be the issue
> 
> Is this the issue you describe? Same footnote anchor style used when
> inserted in different paragraphs with different styles, resulting in line
> spacing issue and anchor font looking e.g. too big?

YES, you are correct.  That said, the commenter after you, ALSO is correct.  Specifically, if I set a Font Size explicitly in the Footnote Anchor character style, then that overrides proper automatic sizing of the anchor in disparate paragraph styles, so that in paragraph styles with smaller fonts, the footnote anchors end up being too large and messing with the proper line spacing, etc.  When this has occurred, it is possible to use the "Reset to Parent" button in the Footnote Anchor character style's Font tab, and then to subsequently again select the desired font (which in my case is automatically set to Arial, upon using Reset to Parent) in that same tab, WITHOUT explicitly selecting a Font Size (i.e., the Size setting must be ignored).  There needs to be a way to choose Automatic for the Size, without having to use Reset to Parent, so that the extra and non-intuitive subsequent step of again selecting the desired Font, etc., may be avoided.
Comment 21 TH 2023-11-07 02:56:11 UTC
(In reply to ajlittoz from comment #19)
> I don't see any problem IFF user modifying the character style leaves font
> size in TRANSPARENT STATE so that font size is inherited from the
> environment. You can change font face without changing font size, but DON'T
> EVER click on or otherwise play with font size.
> 
> Any interaction will SET the size. Unfortunately, present UI doesn't report
> transparent state for attributes, i.e. the fact that the effective value is
> inherited from ancestor styles.
> 
> Since OP didn't provide a sample file, we can't check if this is only a
> problem of unwanted attribute override when configuring the cgaracter style.

If I set a Font Size explicitly in the Footnote Anchor character style, then that overrides proper automatic sizing of the anchor in disparate paragraph styles, so that in paragraph styles with smaller fonts, the footnote anchors end up being too large and messing with the proper line spacing, etc.  When this has occurred, I notice that it is possible to use the "Reset to Parent" button in the Footnote Anchor character style's Font tab, and then to subsequently again select the desired font (which in my case is automatically set to Arial, upon using Reset to Parent) in that same tab, WITHOUT explicitly selecting a Font Size (i.e., the Size setting must be ignored).  That corrective process is NOT obvious and NOT intuitive at all.  There needs to be a way to choose Automatic for the Size, without having to use Reset to Parent, so that the extra and non-intuitive subsequent step of again selecting the desired Font, etc., may be avoided.

I don't know about other attributes in this regard, as I'm only reporting the particular problem I've encountered, and which befuddled me quite a bit until I stumbled upon the above process.
Comment 22 QA Administrators 2023-11-07 03:14:38 UTC Comment hidden (obsolete)
Comment 23 Stéphane Guillou (stragu) 2023-11-07 08:58:58 UTC
(In reply to TH from comment #11)
> [...] Therefore, I recommend either disabling the ability to specify the point
> size for the specified font in the Footnote Anchor and Endnote Anchor
> character styles (and only in those styles), or giving the user some warning
> that applying a specified point size to the font in those anchor style may
> cause improper appearance of the text.
> 
> Bottom line: not specifying, if one has then removing the specification of,
> the point size for the employed font in the Footnote Anchor character style
> solved my issue.

Now that the cause of the issue is clear, that you know of to fix it, and that you have provided your suggestions for improvement, let's categorise this as an enhancement request instead of a bug.

Bringing the UX/Design team back in to decide on if something needs to be done here:
- warning? (I'm against such a warning, as it should apply to any attribute, and many (any?) character style (for example, Internet Link, automatically applied when a URL is recognised)
- disallow changing font size? (I'm against taking away a feature that might very well be useful to some users, and making styles inconsistent)

Related improvements already requested:
- make it easier to spot what comes from the Parent and what is "fixed", without relying on checking what is listed in the Organizer tab: bug 88559, bug 153623
- allow resetting per attribute, not just per tab: bug 89826

Based on the above, my take is "won't fix". Or marking as a duplicate of one existing enhancement request - what do you think, TH?
Comment 24 Mike Kaganski 2023-11-08 09:36:13 UTC
Basically, it's the problem of not supporting inheriting the percentage-defined font size from paragraph style - bug 99544, right?
Comment 25 Heiko Tietze 2023-11-08 09:36:21 UTC
Created attachment 190715 [details]
Sample document

STR: 
* Some text with footnotes, eg. Lorem¹ ipsum² dolor³
* Apply a character style with very small font size to "ipsum" and to "dolor" with very large => footnote anchors adjust properly
* Change the Footnote Anchor character style => hell breaks loose

I would expect that a) "Footnote Anchor" has no effect anymore since I explicitly use different CS, and b) Footnote Anchor uses some percentage, which doesn't work either and something like 80% is calculated to the PS, I guess. Plus, changes to the "Footnote Anchor" are not reliably undone.

As the CS is handled very specifically I agree with TH to disable the font size attribute. However, users who assign a different CS per Tools > Footnote & Endnote run into trouble anyway. Ultimately the footnote characters should not use a dedicated style but some modifier attributes to the used CS/PS (namely position only). Doubt this makes everyone happy.

MSO seems to have no style for footnotes. There is no way to colorize all anchors, for example (and the formatting from the example is not read correctly).
Comment 26 Heiko Tietze 2023-11-08 09:38:46 UTC
(In reply to Mike Kaganski from comment #24)
> Basically, it's the problem of not supporting inheriting the
> percentage-defined font size from paragraph style - bug 99544, right?

You were too fast ;-). I think yes but also to accept different CS and not hi-jack by changes to the Footnote Anchor style.

UX-wise I'm against a warning, static info or the like, and think we should not restrict users as best as possible. So this issue should be treated as bug.
Comment 27 Stéphane Guillou (stragu) 2023-11-08 10:04:33 UTC
(In reply to Heiko Tietze from comment #25)
> STR: 
> * Some text with footnotes, eg. Lorem¹ ipsum² dolor³
> * Apply a character style with very small font size to "ipsum" and to
> "dolor" with very large => footnote anchors adjust properly
I don't think this report was ever about changing the character style of the body text.
And I don't reproduce the change in anchor font size in 7.5.8 nor 24.2alpha0+ anyway, they still only respond to changes in the surrounding paragraph style for me. Which version did you use?
> * Change the Footnote Anchor character style => hell breaks loose
I assume you mean change which CS is used for footnote anchors in Tools > Footnote/Endnote settings?
In that case, I can only see the problem with not being able to undo the change. But that's a different issue altogether.
Comment 28 Stéphane Guillou (stragu) 2023-11-08 10:11:45 UTC
(In reply to Heiko Tietze from comment #26)
> UX-wise I'm against a warning, static info or the like, and think we should
> not restrict users as best as possible. So this issue should be treated as
> bug.
In essence, my understanding is:
- TH's original issue as "not a bug"
- I changed it into an enhancement request to make it less likely that users think they hit a bug, but to me (and to you, according to the quote above), TH's suggestions are "won't fix"
- Mike and I suggested potential reports to mark as duplicate of, as an alternative.

I think your testing revealed different issue(s) which should be reported separately, Heiko, given that we're at 28 comments already.
Comment 29 Heiko Tietze 2023-11-08 10:12:52 UTC
(In reply to Stéphane Guillou (stragu) from comment #27)
> I don't think this report was ever about changing the character style of the
> body text.
It was not mentioned. But it is about changes to the font size whether per DF or CF.

> And I don't reproduce the change in anchor font size in 7.5.8 nor
> 24.2alpha0+ anyway, they still only respond to changes in the surrounding
> paragraph style for me. Which version did you use?

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 60(Build:1)
CPU threads: 32; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (en_US.UTF-8); UI: en-US
7.6.2-3
Calc: threaded

> > * Change the Footnote Anchor character style => hell breaks loose
> I assume you mean change which CS is used for footnote anchors in Tools >
> Footnote/Endnote settings?
"Footnote Anchor" is a character style (CS) used by default for the footnote numbers in the text.
Comment 30 TH 2023-11-08 22:33:25 UTC
I write a great deal, being an author of many books (under a pen name), which are heavily documented.

I also have a software architect and engineer, as well as a database architect, though NOT in the tools / language used for LibreOffice.

From a UI and UX perspective, and as a writer, it does NOT make sense to be able to set a fixed font size for footnotes or endnotes ACCIDENTALLY (i.e., without intent to do so), and it also does not make sense that undoing such a change should be difficult or inobvious.

Here's my suggestion: Provide a check box next to the Size for the font in the Anchor style, which indicates Calculated.  If that box is selected (and it should be, by default), then changing the font size explicitly would be disabled.  If unselected and the Size is subsequently changed, then re-checking Calculated should remove any "under the hood" explicit font size for the anchor style.  This approach would provide the best of all worlds: the ability to use an explicit font size if desired for the anchor text, and the ability to understand what has occurred and easily undo that explicit specification, reverting to the default calculations for the anchor size, should that be needed / desired.
Comment 31 TH 2023-11-08 22:34:36 UTC
"have a software architet..." should say "am a software architect..."
Comment 32 QA Administrators 2023-11-09 03:16:33 UTC Comment hidden (obsolete)