Description: If you start a new document & change the Default Paragraph Style, the font apparently applied to Character Styles does not change, i.e. in the list box and dialogs they appear with the previous Default Paragraph Style font. Mostly this is not actually applied, but for line numbers the previous font is used. For other character styles this just leads to confusing UI. If a font is not actually defined, then it should be shown in the dialog as ‘undefined’ not as a font that is otherwise not used in the document. Steps to Reproduce: 1. Open new document 2. Change font in Default Paragraph Style 3. Add some lines of text 4. Enable Line Numbers Actual Results: Line numbers are shown in the font of the previous Default Paragraph Style Expected Results: Line numbers should be shown in the font defined in the current Default Paragraph Style, or the Character Style if defined. Reproducible: Always User Profile Reset: No Additional Info: The UI for Character Styles should also show the actual font that will be used and dialogs should accurately report that a font has not been defined for a style, not default to some font that may have once been applied.
*** This bug has been marked as a duplicate of bug 136433 ***
The ‘duplicate’ bug does not mention the wrong font being used for line numbers.
(In reply to Seán Ó Séaghdha from comment #2) > The ‘duplicate’ bug does not mention the wrong font being used for line > numbers. Character styles do *not* depend on the Default Paragraph Style. Instead, when they do not define a property (directly or through inheritance), the used property value is taken from the *actual* paragraph properties where the character style is applied (be it a direct paragraph-level formatting, or *any* paragraph style used there). And in the *Line Numbering* very special case, the character style is *not* applied to any paragraph in the text, with some paragraph-level properties. Instead, it is used in a special area (generated aside from the text), and thus it depends on a *global default*, not defined through styles in any document. In LibreOffice, the global default is defined through Options->Writer->Basic Fonts. That setting page, unfortunately, has a *separate* effect of *also* defining the Default Paragraph Style (and other styles) font, but that is the unfortunate and is tracked elsewhere. This is not a bug. A possible improvement could add an explicit font definition to this specific character style, because of its special usage, so that user would not face some global defaults.
(In reply to Mike Kaganski from comment #3) > thus it depends on a *global default*, not defined through styles in any > document. Or rather, defined by a special <style:default-style style:family="paragraph"> setting in documents, that is not exposed in the UI other than by the mentioned Options->Writer->Basic Fonts, which combines setting the *three* things: global application default used for new documents, 'style:default-style' for current document, and also "Default Paragraph Style" of the current document.
It may not be a bug in the strict sense of a malfunction, but it certainly looks and functions like a bug to the end user. Having mysterious external defaults just makes Writer look unpredictable.
(In reply to Seán Ó Séaghdha from comment #5) Having mysterious external defaults just makes Writer look unpredictable. Sure. If you want to make this issue focused on that aspect, it's OK. However, it depends on Options dialog defining some document-specific settings (bug 43786, bug 105751, bug 144814, bug 151918); and also it needs some consideration how exactly to expose that special set of 'style:default-style' elements in the UI. That needs some UX consideration; actually, I had never thought if we should add a top-level entry for all out styles, which would represent those elements and serve as the true inheritance root. I set it to NEW, and ask for UX feedback; please note that this implies that we have some "really default paragraph style" entry above the existing "Default Paragraph Style", representing the two ODF elements 'style:default-style style:family="paragraph"' and 'style:style style:name="Standard" style:family="paragraph"', respectively.
(In reply to Mike Kaganski from comment #6) > I set it to NEW, and ask for UX feedback; please note that this implies that > we have some "really default paragraph style" entry above the existing > "Default Paragraph Style" Or we really should have all such defaults gathered in a separate Document Properties dialog, where such "really default styles" could be put as a special case, with the properties in the Options only defining global default for new documents.
My take on this issue... 1. Line numbering (LN) numbers are not in a paragraph, nor do they constitute paragraphs when taken together. 2. LN styling should happen at one of the following scopes: document, section or page; I'm not sure which I think is better. 3. LN styling could, perhaps, use a CS, e.g. analogously to footnote references. However - one could argue against this, in the sense that the font size at least is set dynamically based on the counted line's effective height etc. (I should also mention that the LN font size setting logic is a bit strange and sometimes buggy, see #0, #6)" href="show_bug.cgi?id=152548">bug 152548 I just filed for example); so maybe a CS with some aspects of it disabled? Or ignored? 4. Focusing on the issue at hand, though: What control should the user even have on LN font sizes, given how they're changed dynamically? Perhaps it should be no control at all! Perhaps if should be just a maximum size? toggleable maximum size? I wonder if there is an actual offician decision about that. For now, let's assume the control we want is the maximum size. 5. Regardless of the merits of "Options->Writer->Basic Fonts" - it does not control the LN font size, at all, in my experience. Mike, are you seeing something different? 6. "This is not a bug" - if LN font size should be controlled at all (and see (4.)) - then this _is_ a bug. There is, indeed, no obvious UI for setting this (maximum) font size. 7. About "Options->Writer->Basic Fonts" - I really dislike this, for two reasons. First, it is a bug that settings which affect the current document are found in the LO options dialog (bug 144814 ; Seán - please consider visiting that and expressing your opinion). Second, "Basic fonts" is something the confuses and befuddles me: WTF are "basic fonts"? Fonts for what? For where? What's basic about them? I also notice that when I change the Default PS' font size - many of the "basic fonts" chage. So - it looks like this just mirrors settings in some of the styles (and is not just tracked by values in styles, as Mike notes in comment #3 - it's a two-way tracking, looks like). I typically forget that dialog even exists, to be honest. 8. Widening the focus again to LN styling in general - due to (1.), the styling of LN should not use the default CS of a PS, as such. But I suppose the CS for LN could be initially set to be the same as the CS of the default PS of the default Page Style. At least, I don't have a better idea. 9. As for whether changes to the default CS of the default PS affect the LN CS: In principle, I don't see why they should. At the very least such effects should be optional. But this immediately reminds me of Mike's comment #3 and the question of style feature inheritance or relativization (see e.g. bug 127702). 10. Mike, you asked for UX feeback: I want to be able to change the LN style (and specifically maximum font size) by right-clicking the LN area or an actual LN number at least; and via Tools | Line Numbering. I'm not saying the UI for this styling should be on these actual menu and dialog respectively, but I should be able to access it via those two places IMO.
(In reply to Eyal Rozenberg from comment #8) > 3. ... > > 4. ... > > 5. ... > > 6. ... I don't see how the size is so important for this issue, which was initially filed with an incorrect user assumption that LN settings depend on Default Paragraph Style (no), and then grew to the need to *introduce* an UI for the actual source of those settings. And in fact, all this is not really related to the LN; this feature just happen to highlight the problem of no UI for the really default (paragraph/frame/whatever) settings, which are stored in the document as special "default-styles", but are inaccessible for user, except for *some* pieces in the most awkward place.
(In reply to Mike Kaganski from comment #9) > I don't see how the size is so important for this issue You're right, I was subconsciously focused on the size issue because of #0, #6)" href="show_bug.cgi?id=152548">bug 152548. > And in fact, all this is not really related > to the LN; this feature just happen to highlight the problem of no UI for > the really default (paragraph/frame/whatever) settings, which are stored in > the document as special "default-styles", but are inaccessible for user, > except for *some* pieces in the most awkward place. Hmm. Well, my focus was on setting the font used in LN specifically - and in the current document, not the default for future documents. Do you think I should make that into a separate bug?
(In reply to Eyal Rozenberg from comment #10) > Hmm. Well, my focus was on setting the font used in LN specifically - and in > the current document, not the default for future documents. Do you think I > should make that into a separate bug? If you think there's an issue here, then yes, please do (I myself feel it's OK, because the special treatment of one single style property used for this function does not make the idea of character style for the feature totally wrong/inconsistent/otherwise bad; numerous other properties are perfectly applicable, and the special treatment is rather a LN feature specific - but it's just my personal opinion).
I’m curious now about how this situation came about. What is the use case for having separate styles ('style:default-style style:family="paragraph"' and 'style:style style:name="Standard" style:family="paragraph"')? Is this just because styles in the interface require a name? But since it’s not the name that’s shown anyway... How is having these separate styles actually useful? (ignoring for the moment the complexity of collapsing them)
(In reply to Seán Ó Séaghdha from comment #12) > I’m curious now about how this situation came about. What is the use case > for having separate styles ('style:default-style style:family="paragraph"' > and 'style:style style:name="Standard" style:family="paragraph"')? 'style:style style:name="Standard" style:family="paragraph"' is a normal paragraph style. It may be used as an ancestor in inheritance hierarchy; but it is not a required hierarchy root. Any paragraph style may be set to not inherit from *any style*, and become a root of own inheritance hierarchy (creating a "forest" of paragraph style hierarchy trees). From the file format point of view, the need to store the defaults applicable to *any* style of a given family (paragraph/text/...) that does not define a property in its inheritance tree requires such 'style:default-style' elements. They *allow* (but do not force) to create files that do not depend on user settings and/or program versions (which may change the defaults). The documentation for style:default-style is at https://docs.oasis-open.org/office/OpenDocument/v1.3/OpenDocument-v1.3-part3-schema.html#element-style_default-style.
(In reply to Mike Kaganski from comment #4) > Or rather, defined by a special <style:default-style > style:family="paragraph"> setting in documents... (In reply to Mike Kaganski from comment #6) > I set it to NEW, and ask for UX feedback... needsUXEval requires CC ux-advice@... To recap STR: 1. Tools > Options > Writer > Basic Fonts: Default = something ridiculous 2. Some text, line number on => line numbers follow the paragraph default 3. Change Default Paragraph Style back to Liberation Sans, or the like => line numbering follows (I read the discussion as if it doesn't) What am I doing differently? Version: 7.4.3.2 / LibreOffice Community Build ID: 40(Build:2) CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: kf5 (cairo+xcb) Locale: de-DE (en_US.UTF-8); UI: en-US 7.4.3-4 Calc: threaded
(In reply to Heiko Tietze from comment #14) > To recap STR: > 1. Tools > Options > Writer > Basic Fonts: Default = something ridiculous > 2. Some text, line number on => line numbers follow the paragraph default > 3. Change Default Paragraph Style back to Liberation Sans, or the like => > line numbering follows (I read the discussion as if it doesn't) > > What am I doing differently? No idea, because you chose not to explain how you performed #3.
(In reply to Mike Kaganski from comment #15) > (In reply to Heiko Tietze from comment #14) > > 3. Change Default Paragraph Style back to Liberation Sans, or the like => > > line numbering follows (I read the discussion as if it doesn't) > No idea, because you chose not to explain how you performed #3. Stylist > right click > font... does it matter?
Created attachment 184545 [details] Screencast (In reply to Heiko Tietze from comment #16) > Stylist > right click > font... does it matter? Yes is does; and doing that through stylist (F11) exactly *shows* the issue of line numbering *not* following the font change. It would follow the change, *if* you used Tools > Options > Writer > Basic Fonts: Default again for #3. So are you really sure you don't repro in your comment 14, when #3 uses your comment 16?
The numbers used in "Line Numbering" are styled by the character style "Line Numbering". To change the font alter that style or select a different one and set the font there. The line numbering dialog has a drop-down list to determine the to be used character style. That is similar to the list style dialog where you can determine the character style for the list numbering. So I thought that would be obvious, but apparently not. Most (all?) of the predefined character styles do not set a font. That way the font defined in the paragraph where a portion of text is located is used when the character style is applied to that portion of text. "Line Numbering" is different as the numbers are not inside a paragraph. But do we want line numbering to follow the paragraph of the same line, for example? That would result in different character styles in the column of line numbers when e.g. a block quote has a different font than the surrounding text, or when headings have a different font than the basic text. So I think, that would be no good solution.
(In reply to Regina Henschel from comment #18) > "Line Numbering" is different as the numbers are not inside a paragraph. But > do we want line numbering to follow the paragraph of the same line, for > example? That would result in different character styles in the column of > line numbers when e.g. a block quote has a different font than the > surrounding text, or when headings have a different font than the basic > text. So I think, that would be no good solution. I agree. If there are different paragraphs with different font families, I don't want to see the LN font family change in the middle of the page. But then, I also don't like to see the LN font _size_ change on the same page; I would expect to be able to choose whether LN font, including size, is made uniform over a full section. However... it seems that can't happen right now. But maybe that is a separate issue.
(In reply to Mike Kaganski from comment #17) > Created attachment 184545 [details] I think I was fooled by the fact that changing the Default PS affects Tools > Options > Basic Fonts. Interestingly all/most CS keep the initial Default PS font, although it has no effect in most cases. Obviously not in case of Line Numbering. It seems that we have a deeper problem - CS should follow / not modify the actual Default PS (instead of being initialized once), and a NAB situation for the line numbering - use Default PS and allow modification via CS "Line Numbering" (with another minor issue that this CS is not listed with applied styles).
Please let us split several problems apart, and avoid confusing situation of mixed discussions of different problems. 1. There is a problem of document properties (namely, various 'style:default-style') that specify various defaults used in many places, and are inaccessible for user (comment 4). 2. There is a problem of inconsistent behavior for controlling *one* aspect of *one* of those defaults (namely, font of paragraph's default-style) (much of related discussion in bug 152550). 3. There is a problem of inconsistent placement of the UI for #2 (also bug 152550 comment 6; also there is a generic bug 144814). 4. There is a problem (?) of the *size* of the line numbering (comment 19 seems to imply that it may change in the middle of a page, or at all?). 5. There is a problem (?) of discoverability of font control using the character style (comment 18 seems to imply that OP had problems related to that, while IMO the whole original problem is more like expectation that the default comes from Standard paragraph style, not from the hidden #1; also comment 20).
(In reply to Mike Kaganski from comment #21) > Please let us split several problems apart, and avoid confusing situation of > mixed discussions of different problems. I have written bug 152962 to extend the help about styling the numbers of a line numbering.
Created attachment 186537 [details] A minimized FODT from a real document with non-standard default-style affecting page background The attachment contains a minimal reproducer of the same problem. Namely, in https://forumooo.ru/index.php?topic=9750, a document appeared with page background set, but not active in the text body and header/footer, despite all the properties of page, paragraphs, and characters (style and direct) do not set the white background. The problem is this: <style:default-style style:family="paragraph"> <style:paragraph-properties fo:background-color="#ffffff"/> </style:default-style> It defines the background, and it has *no* UI at all. User has no way to "fix" the document (or to set up such an effect themselves, if desired). I don't know where the problematic document came from. Maybe it is generated by another ODF generator. But the lack of UI for the wide range of settings available in those style:default-style elements is bad.
Note my related comment in 153623, which is: This default font should not be used for font dialogs in Character Styles which don't define their own override font.