Bug 139359 - Inserting a special character uses lots of direct formatting
Summary: Inserting a special character uses lots of direct formatting
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Special-Character
  Show dependency treegraph
 
Reported: 2021-01-01 19:52 UTC by Telesto
Modified: 2024-01-04 14:57 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2021-01-01 19:52:07 UTC
Description:
Inserting a symbol does insert lots of direct formatting

Steps to Reproduce:
1. Open Writer
2. Sidebar -> Style Inspector
2. The the special symbol picker.. Pick say € symbol  

Actual Results:
All sorts of DF

Expected Results:
Non?.. CTRL+M removes the DF without affecting the content?


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.2.0.0.alpha0+ (x64)
Build ID: 4e3ce9dd6ace0b22f7b3f45cf2338b201f4dc305
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 1 Telesto 2021-01-01 19:54:36 UTC
@V Stuart.. 
Not sure if this being your area of expertise. If this being normal/expected or not. It doesn't align well with the people liking favoring styles (and probably also messy at XML level)
Comment 2 V Stuart Foote 2021-01-01 20:54:44 UTC
Expect the amount of formatting will depend on if the symbol being inserted is found in the font assigned to the paragraph.  

A per os/DE font fallback is used when font replacement occurs. If replaced, the span holding the glyphs picked from the Special Symbol dialog will show as DF.

Try it for a symbol that is in the font of the styled paragraph. Also, easy to see what happens if you look at the document export to ODF as Flat ODF.
Comment 3 Telesto 2021-01-01 21:31:10 UTC
(In reply to V Stuart Foote from comment #2)
> Expect the amount of formatting will depend on if the symbol being inserted
> is found in the font assigned to the paragraph.  
> 
> A per os/DE font fallback is used when font replacement occurs. If replaced,
> the span holding the glyphs picked from the Special Symbol dialog will show
> as DF.
> 
> Try it for a symbol that is in the font of the styled paragraph. Also, easy
> to see what happens if you look at the document export to ODF as Flat ODF.

I'm still kind of confused by this.. 
* CTRL+M removes all of this information.. (desired/undesired/ makes sense?) 
* This doesn't happen with 'normal editing.. you get all those special fall back settings for free. If you insert a symbol and go typing again.. the DF will be present all over the place.. And interfering with 'use styles' concept..

It also hits the unwanted (additional) direct formatting topic..

Hope someone having a proposal here :-)
Comment 4 Heiko Tietze 2021-01-12 14:27:33 UTC
We should avoid DF and use only if the font is different than what is used in the paragraph. Mike, what do you think?
Comment 5 Mike Kaganski 2021-02-15 15:34:47 UTC
The DF that I see upon inserting € symbol:

* Char Font Char Set
* Char Font Char Set Asian
* Char Font Char Set Complex
* Char Font Family
* Char Font Family Asian
* Char Font Family Complex
* Char Font Name
* Char Font Name Asian
* Char Font Name Complex
* Char Font Pitch
* Char Font Pitch Asian
* Char Font Pitch Complex

Two questions here:

1. Are all these useful here?
2. Are those that are useful should be always set?

I have no answers, but I want to mention what could affect the answers:

1. The use of properties that do not relate to the inserted symbol (like Asian font name for Euro character) may be unnecessary, and even arbitrary: the character dialog does not provide you a selector for fonts for Asian/Complex scripts, so they look quite arbitrary here. When one just sets a western font as DF (selecting the font from Font Name toolbar control), the only DF properties set are "Char Font Char Set", "Char Font Family", "Char Font Name", and "Char Font Pitch".
2. Font pitch looks completely unrelated. Insertion of a symbol does not seem to involve setting pitch in any way. However, I have no idea why is it set also when one sets just font, as mentioned above. I am not an expert in typography, and may miss something here.
3. If the DF is needed when the new properties match the existing properties (like when the style has the same font name) would depend on how much you consider the *symbol* as an object or as a usual character. I imagine there might be both use cases, when one just uses special character dialog to access characters not available in one's keyboard layout (so inserted symbol is just a normal character), and when one wants to have things with specific look and feel (like "bullets"); and also when the otherwise normal characters could be  unusual enough to require specific font, so that one might expect that whatever the paragraph font is, the symbol's font is specific (reasoning like "I used that font in the dialog; I want it to stick no matter what").

Personally I'd prefer to have a special entry in the dialog's font selector, like "current font", so when I used that entry, the character would not have any DF, and when I used an explicit font, the necessary DF would be added regardless of current paragraph/character formatting. That would provide enough flexibility and full control; the "current font" entry would pick what is under the cursor, and could be the default...
Comment 6 Mike Kaganski 2021-02-15 15:54:03 UTC
(In reply to Mike Kaganski from comment #5)
> 2. Font pitch looks completely unrelated. Insertion of a symbol does not
> seem to involve setting pitch in any way. However, I have no idea why is it
> set also when one sets just font, as mentioned above. I am not an expert in
> typography, and may miss something here.

Ah, so this is just a value of DONTKNOW, FIXED and VARIABLE - not what I thought about ("character per inch").

Also the four properties are just a way to describe different aspects of *one* actual property - chosen font. So the set of 12 bullets in comment 5 in fact only describes 3 actual properties: Western font (its name, charset, family, and pitch), Asian font, and Complex font.

A possible question for a *different* request could be merging these four sub-properties into some single complex meta-property (but then it would not match the actually usable property names, making it harder for macro writers to understand what to set in their macros; could be in turn solved using descriptive tooltips).
Comment 7 Dieter 2022-02-16 15:24:28 UTC
Still same behaviour in

Version: 7.3.0.3 (x64) / LibreOffice Community
Build ID: 0f246aa12d0eee4a0f7adcefbf7c878fc2238db3
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Heiko, I don't understand, why you see that as enhancement. For me it looks like a bug. I'm not a developer, but I think special character should be inserted as "Unformatted text" by default. Just copy a special character with DF in one document and paste it as "Unformatted text" in a new document and there is no DF. That should work also, when inserting from the special character dialog or from special character dropdown menu.
Comment 8 Mike Kaganski 2022-02-16 15:36:10 UTC
(In reply to Dieter from comment #7)
> Heiko, I don't understand, why you see that as enhancement. For me it looks
> like a bug. I'm not a developer, but I think special character should be
> inserted as "Unformatted text" by default.

Because there is a font selector in the dialog. Because different fonts have different range of characters, and existing characters look different in different fonts. And hence, because not specifying the font as inserted character property may result in absolutely unexpected result for user - namely, something different is inserted, while user wanted specific look that they picked.

Only if you have some special setting (like my imagined "current font" entry (comment 5), or some other like checkbox or alternative insert button), you may use that to not set the direct formatting.
Comment 9 Dieter 2022-02-16 15:43:16 UTC
(In reply to Mike Kaganski from comment #8)
> Because there is a font selector in the dialog. Because different fonts have
> different range of characters, and existing characters look different in
> different fonts.

Mike, you're right of course. Accidently I took a symbol from the same font as the default document font.
Comment 10 Dieter 2023-02-10 06:48:44 UTC
Heiko, you've added keyword "needDevAdvice" two years ago. Sometimes it looks to me the same as "Send bug into a deep sleep". So two questions:
a) Is there a certain mail-address, that should be connected with that keyword
b) Is it clear enough, what kind of advice is needed?
Comment 11 Heiko Tietze 2023-02-14 09:54:39 UTC
Looking into the history it seems I added needsDevAdvice and CC'ed Mike together. He gave his reply, so we can remove the keyword.
Comment 12 Eyal Rozenberg 2023-05-13 15:29:58 UTC
Note that the new related bugs are about:

* Possibly (but not always) not inserting _any_ DF.
* If DF is inserted, making sure it does affect text typed in after the special character.

So they kind of complement this bug about reducing the amount of DF, when it is inserted.
Comment 13 Eyal Rozenberg 2023-05-13 15:40:22 UTC
(In reply to Mike Kaganski from comment #5)
> 1. Are all these useful here?

Let me rephrase: "Which of these are legitimate here?"

The justification for DF here is ensuring that the glyph the user selected in the dialog is the one that gets inserted. Anything not contributing to that - should _not_ be inserted. So, looking at:

> * Char Font Char Set
> * Char Font Char Set Asian
> * Char Font Char Set Complex
> * Char Font Family
> * Char Font Family Asian
> * Char Font Family Complex
> * Char Font Name
> * Char Font Name Asian
> * Char Font Name Complex
> * Char Font Pitch
> * Char Font Pitch Asian
> * Char Font Pitch Complex

at most one of each of these triplets is legitimate, the rest aren't (and of course - it depends on which "language group" each Unicode character is associated with; I don't like the language group concept but that's a whole other kettle of fish, bug 151215, comment 19 by Mike also).

So, let's assume we're inserting a character being part of language group LG. This leaves us with:

* Char Font Char Set LG
* Char Font Family LG
* Char Font Name LG
* Char Font Pitch LG

The first, third, and fourth items here are irrelevant, as we do not choose them in the dialog: We choose a Unicode character and a font family. So,

* Char Font Char Set LG

(whichever one of the three that might be) is the only legitimate piece of DF to apply. Applying the rest is a bug.


> 2. Are those that are useful should be always set?

We should let the user decide whether they want to coerce a specific font family or just insert a character using the same font(s) as the surrounding text, see bug 155274. That will resolve this question as well.

> Personally I'd prefer to have a special entry in the dialog's font selector,
> like "current font",

That's bug 155274 exactly.
Comment 14 Mike Kaganski 2024-01-04 14:54:23 UTC
Note how bug 159018 (Calc) complains about exactly the reverse: it seems, that the function in Excel does *not* apply proper direct format to the inserted character; and this causes grief ...
Comment 15 Heiko Tietze 2024-01-04 14:57:34 UTC
(In reply to Mike Kaganski from comment #14)
> Note how bug 159018 (Calc) complains about exactly the reverse...

That's why I suggested a checkbox in bug 155957.