Character style that does not impose font

Can a character style not have an associated font?

The built- in character styles have associated fonts. I am going through and manually changing all of them in every template I use to match the font in the “default paragraph style” or “Heading” style (whichever is appropriate), but this seems absurdly time-consuming. It also forces me to not use the same character style to modify body text and headings, so I suspect that I will eventually have to make duplicates of lots of character styles just to use a different font, which seems silly.

Edit:

I just saw this relevant question, but the answer claims that “The [Style and formatting] dialog shows a lot of properties, but that are the inherited values”, but almost all character styles in my template use the Liberation Sans or Liberation Serif font even though that font is used in none of my paragraph styles. They also inherit from “none”, so I have no idea where this font choice came from.

Does the dialog just always show Liberation fonts if none is set?

By default, except built-in Source Text, character styles have no font property set.

Unfortunately, the UI has a limitation: it is unable to display a “void” value. It always displays something. If the property is not forced (i.e. manually set or reset), the UI shows the inherited value, ultimately the value in Default Paragraph Style (yes, I wrote “Paragraph” even for character styles because Default Character Style is not a real style).

In your case, Liberation Serif is likely the font face selected in Tools>Options, LibreOffice Writer>Basic Fonts (Western) with its size and weight.

But as said above, this can be a forced value if you ever touched the setting (even to “restore” it to its default).

The only way to revert all values in the open tab to “default” values, i.e. inherited values, is to press the Standard button.

So as long as you never click on the font face selector, your character style will not force any font and use whichever is defined in the paragraph style. This is how built-in Emphasis and Strong Emphasis are configured and they work equally well on Text Body or Heading n.

Do you know of any bug report dealing with this UI limitation?

No, but I think it is intrinsic to the widget library.

Check boxes could probably be adjusted for ternary or quaternary values. In some dialogs, when binary attributes are not the same on the whole selection, check box is neither white nor X but show a gray background or a square with white/black on each side of a diagonal.
The same idea could be used, but the implementation is difficult because displaying the inherited value is also an important information.

So for textual inherited value, text could be grayed (but this should not be confused with usual disabled choice). For check boxes and radio buttons, the difficulty is to show the “not set” state. “Set” state could also be grayed with the label in full contrast (to avoid the confusion with a disabled control).

After some testing, I have determined that the font shown for a character style is (often) not actually part of the style, and the modify dialog will show a font as if it is inherited even when no font is inherited.

Reproduce my evidence (I use DPS for “Default Paragraph Style”):

  1. Open the default Default template (unmodified from install)
  2. Change the DPS to have a font other than a Liberation font (I used Open Sans)
  3. (Most of) the character styles should still show a Liberation font in their Modify dialog (and preview)
  4. Write a few word. The text should use the DPS.
  5. Select a word
  6. Apply a character style that seems to set a Liberation font. I used Caption Characters.

The font of the selected text will not change.

Thoughts: the style pane obviously has to use some font to show its contents, and it may be hard for LO to change the font used to display character style previews to match the DPS (or maybe not because this is already implemented for any style that does have an associated font). However, showing the font in the Modify dialog as Liberation for every style that does not have an associated font is confusing to me (and probably to other users). There are likely other settings in the dialog with a similar problem. Note that this is not just a complaint about showing inherited settings because the font is not inherited in these cases. I think I will submit a bug report or feature request.