Bug 152550 - Drop the "Basic Fonts" option dialogs
Summary: Drop the "Basic Fonts" option dialogs
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.0.0 beta1+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Options-Dialog Fonts
  Show dependency treegraph
 
Reported: 2022-12-16 14:35 UTC by Eyal Rozenberg
Modified: 2024-02-12 09:56 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
The Basic Fonts pane in the Options dialog (69.38 KB, image/png)
2024-02-12 09:56 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2022-12-16 14:35:18 UTC
I don't see a justification for the existence of the "Basic Fonts" dialogs (for Western, RTL/CTL, CJK) in LO Options.

In LO, we use styles. We have the Default PS, we have Header, we have Body Text, Caption etc. The font settings in those styles seem to be what's mirrored by this dialog. They make sense; this dialog doesn't.

Now, sure, I would definitely like it if editing the default document template was something more accessible than it is now (how do I even do it anyway?); and perhaps there could be a "font choice wizard" or "document styling wizard" for newbie users, which among other things would present these font choices to users, in some way. But - that doesn't justify taking a few of the aspects of the document template and mirroring them in an Options dialog (both as things stand now, and after fixing bug 144814).

See also bug 33743; other modules don't even have this.
Comment 1 Mike Kaganski 2022-12-16 15:00:25 UTC
There is no "default document template" at all, until you define it manually - e.g. in Templates section of the Start Center. When no template is made the default, LibreOffice uses some settings set in user preferences (like the "Basic Fonts" discussed here, *one of* the functions of which is setting this global user preference, or the user's locale, which defines the page size). If those settings are not set (or even are impossible to set without templates, which is true for most of the numerous document settings), some hard-coded program defaults are used.

I agree that the settings discussed here are very problematic. These settings control these things:

1. User defaults stored in registrymodifications.xcu, used for new documents created when no default template is set:
   <item oor:path="/org.openoffice.Office.Writer/DefaultFont*">
2. <style:style style:name="Standard" style:family="paragraph"> element in the current document;
3. Properties of *some* user-visible pre-defined styles, like "Default Paragraph Style" (which has internal name of "Standard").

And the #3 makes it especially bad, since this makes it completely not obvious how this "feature" also controls #1 and #2 (as if these first two being joined together were not bad enough).

Anyway, the simple removal of this is not a good thing, unless #1 and #2 are moved to proper places (separately). I was sure there was a bug for it, but I can't find it ATM.
Comment 2 Mike Kaganski 2022-12-16 16:27:30 UTC
(In reply to Mike Kaganski from comment #1)
> 2. <style:style style:name="Standard" style:family="paragraph"> element in
> the current document;

Oh sorry; here I intended to write <style:default-style style:family="paragraph">
Comment 3 Eyal Rozenberg 2022-12-17 21:35:14 UTC
(In reply to Mike Kaganski from comment #1)
> There is no "default document template" at all, until you define it manually
> - e.g. in Templates section of the Start Center.

Really? So, the template named "Default" isn't the default? And - can I select one of the templates as the default, then? I don't see any UI for that.

> When no template is made
> the default, LibreOffice uses some settings set in user preferences (like
> the "Basic Fonts" discussed here, *one of* the functions of which is setting
> this global user preference, or the user's locale, which defines the page
> size). If those settings are not set (or even are impossible to set without
> templates, which is true for most of the numerous document settings), some
> hard-coded program defaults are used.

So, what's your opinion about this state of affairs? As opposed to, say, there _always_ being a default template in the user's profile (and if it's missing, one is generated when the module comes up, from hard-code values or from a default-of-default-templates that's not in the user's profile)

> I agree that the settings discussed here are very problematic. These
> settings control these things:
> 
> 1. User defaults stored in registrymodifications.xcu, used for new documents
> created when no default template is set:
>    <item oor:path="/org.openoffice.Office.Writer/DefaultFont*">
> 2. <style:default-style style:family="paragraph"> element in
> the current document;
> 3. Properties of *some* user-visible pre-defined styles, like "Default
> Paragraph Style" (which has internal name of "Standard").

Can you clarify the difference between (2.) and (3.)? Is (3.) outside of the current document? Is it in the default template, if one exists?
Comment 4 Mike Kaganski 2022-12-18 05:44:43 UTC
(In reply to Eyal Rozenberg from comment #3)
> the template named "Default" isn't the default?

Exactly. And it should be renamed because of the confusion the name creates.

> And - can I select one of the templates as the default, then? I don't see
> any UI for that.

File->Templates->Manage Templates (also available from the "Templates" split button in the Start Center), and right-click them there.

> > When no template is made
> > the default, LibreOffice uses some settings set in user preferences (like
> > the "Basic Fonts" discussed here, *one of* the functions of which is setting
> > this global user preference, or the user's locale, which defines the page
> > size). If those settings are not set (or even are impossible to set without
> > templates, which is true for most of the numerous document settings), some
> > hard-coded program defaults are used.
> 
> So, what's your opinion about this state of affairs? As opposed to, say,
> there _always_ being a default template in the user's profile (and if it's
> missing, one is generated when the module comes up, from hard-code values or
> from a default-of-default-templates that's not in the user's profile)

I don't see a problem in the status quo, specifically in this regard. As I mention in bug 152551, not being forced to have a default template file makes it possible to have some dynamic behavior, like page size dependent on the locale. And allowing to set any template as default gives maximum flexibility. IMO, it could only seem confusing because (1) the name of one of the templates (#1 above), and (2) MS Office background.

> > These settings control these things:
> > ...
> > 2. <style:default-style style:family="paragraph"> element in
> > the current document;
> > 3. Properties of *some* user-visible pre-defined styles, like "Default
> > Paragraph Style" (which has internal name of "Standard").
> 
> Can you clarify the difference between (2.) and (3.)? Is (3.) outside of the
> current document? Is it in the default template, if one exists?

No, (3) is about several <style:style style:name="Foo" style:family="paragraph"> in the current document. The only thing outside the document is #1 (User defaults stored in registrymodifications.xcu).
Comment 5 Mike Kaganski 2022-12-18 05:47:22 UTC
(In reply to Eyal Rozenberg from comment #3)
> Is (3.) ... in the default template, if one exists?

Yes, these styles indeed are stored in any document, including any template; and when they are in the template, they are used to create new documents, not the setting here. Same for #2, BTW.
Comment 6 Mike Kaganski 2022-12-18 07:23:12 UTC
(In reply to Eyal Rozenberg from comment #3)
> > I agree that the settings discussed here are very problematic. These
> > settings control these things:
> > 
> > 1. User defaults stored in registrymodifications.xcu, used for new documents
> > created when no default template is set:
> >    <item oor:path="/org.openoffice.Office.Writer/DefaultFont*">
> > 2. <style:default-style style:family="paragraph"> element in
> > the current document;
> > 3. Properties of *some* user-visible pre-defined styles, like "Default
> > Paragraph Style" (which has internal name of "Standard").
> 
> Can you clarify the difference between (2.) and (3.)? Is (3.) outside of the
> current document? Is it in the default template, if one exists?

Let me try once more (sorry, the following is TL;DR).
I suppose that it could look more confusing than it actually is, just because of this confusing dialog.

Please start from the file format / document in mind.
The document has a set of defaults for *any* paragraphs (in ODF, these are stored in the <style:default-style style:family="paragraph">). These defaults are used when any given setting is not set in a given style inheritance hierarchy, so the <style:default-style style:family="paragraph"> may be considered an implicit root of all <style:style style:name="*" style:family="paragraph"> inheritance trees.

Remove any given property from a given ODF, and the program would need to use some default. If there is a configurable setting for it, the default value could (?) be obtained from there (tdf#150377). Or a hardcoded default should be used. Use of hardcoded default instead of a configurable setting has its own pros, like making documents more predictable even with some settings missing from them - *if* the hardcoded default is not likely to change across versions and locales and such.

A document may be created from a template. A template is a document; and creating from a document basically copies everything (just a little bit simplifying), so *everything defined in the template* is used instead of any default or configuration - so defaults/settings are not relevant for template case.

There is an option to not use any template (and this is the default); it has some own advantages (already mentioned flexibility). People may want to keep using it (e.g., because they simply don't want to bother with setting up a template; or because of some other considerations), and at the same time, they might want to define some custom properties for newly created documents (basically, they need something like partial "templates"). This is implemented by having some configurable user settings like '<item oor:path="/org.openoffice.Office.Writer/DefaultFont*">' in registrymodifications.xcu, used only when creating new documents, and only when no template is used for that.

====

With all that (I hope the description is reasonable complete), the behavior is flexible and defined. But the problem arises when one, for some completely weird reason, decides to merge three things in one control in a strange place. The place choice is the least of the problems here - because it's easy to move it anywhere; but no matter where you move it, it will be not less confusing, unless it's split into three (and there is already a place for one of the three).

The specific controls there are font names and sizes:

* Default
* Heading
* List
* Caption
* Index

First, let's skip the most problematic "Default", and look at the rest. They all control only *two* things each:
- the respective properties of respective paragraph styles in the current document;
- the user settings under <item oor:path="/org.openoffice.Office.Writer/DefaultFont*"> in registrymodifications.xcu.

What a user will *see* in the controls when they open this dialog? They will see the values from the current document (you can't have the dialog when Writer document is not current). There's no way to get the values from registrymodifications.xcu - only if they happen to be the same, e.g. because the current document is just created without a template, and the styles are not changed from the defaults...

What will be saved when you press OK? Both. Previously, there was a "[ ] Current document only" checkbox in the bottom of that page, allowing only store that in the styles in current document, but without updating the user defaults in registrymodifications.xcu ... but I don't see it there anymore at least in 7.4.3.2 (I am sure there was some misguided decision to "simplify" the UI related to this).

Now let's look at the most problematic "Default" entry.

1. What does it control?

- The respective properties of <style:default-style style:family="paragraph"> (i.e., the root of *all* paragraph hierarchies);
- the user settings under <item oor:path="/org.openoffice.Office.Writer/DefaultFont*"> in registrymodifications.xcu.

Is this all? No. When setting the <style:default-style style:family="paragraph"> properties, it *also* resets respective properties in <style:style style:name="Standard" style:family="paragraph"> (i.e., the font properties of the "Default Paragraph Style").

So, there are *three* things that it controls.

2. What do you see in the controls when opening the dialog?

You see the value of the respective properties in the "Default Paragraph Style". Not what is stored in style:default-style, nor what is set in registrymodifications.xcu.

Given all that, I wonder how on earth a user could figure all the interrelations of this just by looking on the dialog, reading help, and even much of experimenting, without actually looking inside ODFs and registrymodifications.xcu...
Comment 7 Heiko Tietze 2022-12-19 15:29:16 UTC
(In reply to Mike Kaganski from comment #6)
> Use of hardcoded default instead of a configurable setting has its own pros...

Do you see any cons? Me not. We keep the registry entry so experts could change the value but remove the access via tools > options.

> Previously, there was a "[ ] Current document only" checkbox...

It hasnt changed and is still underneath "Default Languages for Documents".
Comment 8 Mike Kaganski 2022-12-19 16:59:43 UTC
(In reply to Heiko Tietze from comment #7)
> (In reply to Mike Kaganski from comment #6)
> > Use of hardcoded default instead of a configurable setting has its own pros...
> 
> Do you see any cons? Me not. We keep the registry entry so experts could
> change the value but remove the access via tools > options.

So do you confuse my words about possibility to use these settings for *existing* documents without specific settings, with a new (and completely wrong) idea to drop users' ability to define fonts for new documents created without templates?

> > Previously, there was a "[ ] Current document only" checkbox...
> 
> It hasnt changed and is still underneath "Default Languages for Documents".

Facepalm. How a checkbox on Language Settings -> Languages can relate to the discussed settings on Writer -> Basic Fonts?
Comment 9 Mike Kaganski 2022-12-20 08:46:08 UTC
(In reply to Heiko Tietze from comment #7)
> > Previously, there was a "[ ] Current document only" checkbox...
> 
> It hasnt changed and is still underneath "Default Languages for Documents".

FTR: it was removed in 5.1 in commit 745c7bce5fe8b218f7d300667a5409bc7ef58c34 (for no particular reason, it was just imagined that it's "unnecessary" because its value wasn't stored in configuration).
Comment 10 Mike Kaganski 2022-12-20 09:00:21 UTC
... and the discussion was at https://wiki.documentfoundation.org/Design/Meetings/2013-12-29
Comment 11 Heiko Tietze 2022-12-21 10:06:59 UTC
(In reply to Mike Kaganski from comment #8)
> How a checkbox on Language ... can relate to ... Writer -> Basic Fonts?

If the default is English and you switch to Russian with "For the current document only" the document becomes Russian. But it will be English at the next start. Without the option "current document only" it remains Russian after switching. Works like this for Writer and Calc and as a module-agnostic function it ought to be correct.

(In reply to Mike Kaganski from comment #8)
> So do you confuse my words about possibility to use these settings for
> *existing* documents without specific settings, with a new (and completely
> wrong) idea to drop users' ability to define fonts for new documents created
> without templates?

Please elaborate. Changing the language for the current document should be done elsewhere, of course.
Comment 12 Mike Kaganski 2022-12-21 10:58:10 UTC
(In reply to Heiko Tietze from comment #11)
> (In reply to Mike Kaganski from comment #8)
> > How a checkbox on Language ... can relate to ... Writer -> Basic Fonts?
> 
> If the default is English and you switch to Russian with "For the current
> document only" the document becomes Russian. But it will be English at the
> next start. Without the option "current document only" it remains Russian
> after switching. Works like this for Writer and Calc and as a
> module-agnostic function it ought to be correct.

I wrote about the checkbox on the Basic Fonts page. A checkbox controlling a similar functionality on Languages page is totally irrelevant to the discussion, and mentioning it here repeatedly makes the problem confusing. Please only refer to Basic Fonts functionality. Languages are off-topic in this issue.

> > So do you confuse my words about possibility to use these settings for
> > *existing* documents without specific settings, with a new (and completely
> > wrong) idea to drop users' ability to define fonts for new documents created
> > without templates?
> 
> Please elaborate. Changing the language for the current document should be
> done elsewhere, of course.

Please elaborate on your words, to not let me guess what you meant by

(In reply to Heiko Tietze from comment #7)
> (In reply to Mike Kaganski from comment #6)
> > Use of hardcoded default instead of a configurable setting has its own pros...
> 
> Do you see any cons? Me not. We keep the registry entry so experts could
> change the value but remove the access via tools > options.

I *guessed* you suggested to remove the Basic Fonts settings altogether - and I asked if I was right; because if I was right, then your idea had nothing to do with my words that you answered.
Comment 13 Heiko Tietze 2022-12-21 11:21:09 UTC
(In reply to Mike Kaganski from comment #12)
> I *guessed* you suggested to remove the Basic Fonts settings altogether...

Yes, and have it only at the expert options.
Comment 14 Mike Kaganski 2022-12-21 11:24:22 UTC
Do you have any evidence that people don't need it?

https://ask.libreoffice.org/search?q=default%20fonts
Comment 15 Heiko Tietze 2022-12-21 13:58:37 UTC
Wouldn't it be better/more consistent to advice people to create/change a default font?
Comment 16 Mike Kaganski 2022-12-21 14:28:10 UTC
But this is exactly the place to change default fonts.
Comment 17 Heiko Tietze 2022-12-21 14:57:53 UTC
Today it is one method to change the initial font. But what if user also want to change other attributes like font weight on headings or some other style? It's mandatory to deal with templates anyway and using two ways is confusing. I read "drop the basic font options dialog" not just as related to the scripts but as "get rid of all these settings" and agree with this idea.
Comment 18 Mike Kaganski 2022-12-21 16:41:17 UTC
1. Since this is a really highly wanted feature (setting default fonts), you need to consider the workflow setting new fonts (using templates) from a basic user PoV. Currently they go to settings and define fonts; these fonts are assigned correctly through style system, even when the user has no idea what styles are. Is there a *simple* method to obtain the wanted result, without making 100% direct formatting in all new documents? I mean, users in vast majority will simply set the wanted font using the toolbar, and save it as template - and so, every new document will get the direct formatting. And then, suddenly, they will get strange results when they make some paragraph a heading (because they didn't change styles); or when they create a table and then type after it after pressing Alt+Enter in the last cell...
2. Is current way (File->Templates->Save As Template) discoverable enough for basic users?
3. You need to consider other side effects. E.g., new documents will have fixed language, page format, as defined in the template, not set dynamically based on current user settings.

Templates are for people who really need highly customized defaults. For most, trying to enforce dealing with templates and styles would be really unneeded and excessive complexity.
Comment 19 Eyal Rozenberg 2022-12-23 20:32:34 UTC
(In reply to Mike Kaganski from comment #6)
> Remove any given property from a given ODF, and the program would need to use 
> some default. If there is a configurable setting for it, the default value 
> could (?) be obtained from there Or a hardcoded default should be used. Use of 
> hardcoded default instead of a configurable setting has its own pros, like 
> making documents more predictable

So, why not just "combine" the hard-coded defaults, configurable defaults, and template-based creation? When an LO module starts, and if there is no default template - create a template (with default-default values) for the user, and make it the default template. From then on, you only allow a replacement of the default template, never a simple "de-selection" into a no-default-template state. And no more use of registrymodifications.xcu for any of this stuff.

Benefits:

1. The "root defaults" are fully configurable (not just fonts - everything).
2. No need for special UI for editing the "root defaults" - you set them by editing the default template.
3. If a user hasn't touched the default template file, then they're using those hard-coded defaults - which have simply been copied into the template.
4. Can keep the hard-coded defaults out of the code: Just have a default-default-template file, part of the LO distribution but not in the editable templates directory (or hide it inside an .so / .dll or whatever). So, no code paths involving hard-coded values, just a check for existence of a default template.
5. Can forget about that part of the "registry" with the configurable defaults.

Detriments:

1. It's slower to use a template than hard-coded values. But - we already some configurable defaults...
2. Some may argue that the specific default font settings we now have are more accessible to novice users then locating the default template, opening it for editing, and making changes to a bunch of default styles.
3. Transition from current scheme of things may be a bit confusing/inconvenient, may have some tombstone definitions in the registry etc.
Comment 20 Eyal Rozenberg 2022-12-23 20:51:29 UTC
(In reply to Mike Kaganski from comment #6)
> Templates are for people who really need highly customized defaults. For
> most, trying to enforce dealing with templates and styles would be really
> unneeded and excessive complexity.

So, this is my mentioned detriment (2.) . I said "some may argue", because, well, I've always been wary of setting any defaults in LO Settings. It's a scary place where it's difficult to figure out what effect your actions will have. Also, I'm not sure inexperienced users would even explore the LO settings hierarchy. Still, I recognize that adopting my suggestion would also necessitate doing some serious UI work to make it easier and accessible for inexperienced users to make changes to the "root defaults", i.e. in my suggestion to the default template.

One way to achieve this would be having the style dialogs include some button or more complex UI which actually does this for you, which you would notice as you are surveing a Style's features. I think MS Word has something like that:

http://www.addbalance.com/usersguide/images/2010StylesOrganizer.png

And the link takes you to a "Style Organizer" for copying styles to the default template.

https://www.avantixlearning.ca/wp-content/uploads/2015/09/StylesOrganizer.png
Comment 21 Heiko Tietze 2024-02-12 09:34:26 UTC
Some yay/nay arguments, yet I see not enough backup to remove the option dialog. But let's keep the ticket.
Comment 22 Eyal Rozenberg 2024-02-12 09:56:46 UTC
Created attachment 192514 [details]
The Basic Fonts pane in the Options dialog