Bug 155957 - Recent and Favourite Special Characters lists' preview doesn't match what is inserted when using the dialog (should insert using the same font)
Summary: Recent and Favourite Special Characters lists' preview doesn't match what is ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.0.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.8.0 target:24.2.1
Keywords:
Depends on:
Blocks: Special-Character
  Show dependency treegraph
 
Reported: 2023-06-21 10:56 UTC by Jens-D Doll
Modified: 2024-02-28 12:03 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
my recent special chars (49.64 KB, image/png)
2023-06-21 10:56 UTC, Jens-D Doll
Details
Rhombus from wingdings (60.56 KB, image/jpeg)
2023-12-19 08:45 UTC, Jens-D Doll
Details
results of comment 8 steps, with unicode-compliant fonts (111.35 KB, image/png)
2024-01-03 20:47 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens-D Doll 2023-06-21 10:56:59 UTC
Created attachment 188037 [details]
my recent special chars

When I want to insert a special char and click on the menu item a popup appears. In this popup some recent chars are shown. When I click onto the fith recent char to insert it, the fourth recent char is inserted. That is embarrasing. 

It looks as if the buttons for the chars are in disorder.
Comment 1 Stéphane Guillou (stragu) 2023-06-21 11:48:42 UTC
I could not reproduce with:

Version: 7.4.7.2 / LibreOffice Community
Build ID: 723314e595e8007d3cf785c16538505a1c878ca5
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Nor with:

Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 36ccfdc35048b057fd9854c757a8b67ec53977b6
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Could you please test again with version 7.5.4, as the 7.4 version won't see further updates, and let us know if you can still reproduce?
https://www.libreoffice.org/download/download-libreoffice/

Thank you.
Comment 2 QA Administrators 2023-12-19 03:11:28 UTC Comment hidden (obsolete)
Comment 3 Jens-D Doll 2023-12-19 08:45:49 UTC
Created attachment 191499 [details]
Rhombus from wingdings
Comment 4 Jens-D Doll 2023-12-19 08:49:00 UTC
It is a problem of the char set of the char shown on the button. [see image Rhombus] The char I want to insert stems from "wingdings" and is shown correctly. But if I press the button a char with the same char code, but with char set "liberation serif" is inserted. This is misleading.
Comment 5 QA Administrators 2023-12-20 03:13:04 UTC Comment hidden (obsolete)
Comment 6 Stéphane Guillou (stragu) 2023-12-21 09:49:55 UTC
Reproduced in :

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 29b11fa3b5574dc3f42f55b0716f71054030c6c2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Already the case in 6.0.

Glyph shown in Recent and Favourite lists and the large preview use the font at the time of insertion, but inserting it uses the font currently active (where the cursor is, or selected in the dialog's font combobox).

To solve the mismatch, either we:
    • constantly update the preview and character displayed in the favourites / recent list to match the active font in the combobox (and therefore matching the main character grid); or
    • use the font that was used when the character was inserted (and therefore switch the font that is active in the dialog when the list item is clicked), instead of using the active font where the cursor is located.

I can see how some users might want to save favourite glyphs _from a specific font_. The Wingdings case is an extreme example that will only get less and less relevant over the years, as unicode covers more and more symbols and these non-unicode dingbats are less and less commonly used. However, glyphs for a same codepoint can vary greatly between fonts and therefore there is value in storing codepoint + font.

Note that the Recent and Favorite lists will list two entries if the same character is inserted using two different fonts, so it is ven more understandable that the user expects to see this exact same glyph being inserted.

First solution would mean we would sometimes get empty boxes in the lists (or we would have to implement a visual feedback and tooltip that mean "this codepoint is not covered by the currently selected font").

So maybe second solution? Eyal, UX/Design team?

Related: bug 155274.
Comment 7 Heiko Tietze 2024-01-03 12:31:37 UTC
If I insert some Noto Sans Symbols glyph into a paragraph with Liberation Serif it is inserted with this particular font. Does your font still exist on the system?

Bug 139359 asks to avoid too much DF with special characters.

Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: 60(Build:1)
CPU threads: 32; OS: Linux 6.6; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (en_US.UTF-8); UI: en-US
7.6.4-2
Calc: threaded
Comment 8 Stéphane Guillou (stragu) 2024-01-03 17:35:00 UTC
(In reply to Heiko Tietze from comment #7)
> If I insert some Noto Sans Symbols glyph into a paragraph with Liberation
> Serif it is inserted with this particular font. Does your font still exist
> on the system?
Noto Sans Symbols is not a dingbat font so the issue won't be as apparent if the glyph matches between fonts. But still, users might prefer one font over the other for one particular codepoint.

My steps with a dingbat font, to make the issue more obvious:
1. Insert with special character dialog the Wingdings pencil character (decimal: 61473).
2. Go to new paragraph, make sure it uses Liberation Serif (for example by applying the Default Paragraph Style)
3. Open Special Character dialog, see that the Recent Characters shows the pencil character. Click on it: the preview also shows the pencil. Click Insert.

Result: some point glyph is inserted instead (decimal: 1). The character shown in the dialog (recent/favourite lists, preview) does not match what is inserted.

Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: e19e193f88cd6c0525a17fb7a176ed8e6a3e2aa1
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 9 V Stuart Foote 2024-01-03 19:42:54 UTC
(In reply to Stéphane Guillou (stragu) from comment #8)
>
> My steps with a dingbat font, to make the issue more obvious:
> 1. Insert with special character dialog the Wingdings pencil character
> (decimal: 61473).
> 2. Go to new paragraph, make sure it uses Liberation Serif (for example by
> applying the Default Paragraph Style)
> 3. Open Special Character dialog, see that the Recent Characters shows the
> pencil character. Click on it: the preview also shows the pencil. Click
> Insert.
> 
> Result: some point glyph is inserted instead (decimal: 1). The character
> shown in the dialog (recent/favourite lists, preview) does not match what is
> inserted.

That is actually expected.

Unfortunately decimal 61473 or hex U+F021 is a glyph from the fonts Private Use Area -- no *reliable* font fall back can occur. In Wingding it is a left downward pencil, in Webdings it is a spider, in Symbol it is an exclamation mark. 

Dingbat glyphs from Winding or Webdings have mostly been mapped out to Unicode. [1] so should not be needed or used in preparing documents.

For example The Wingding 61473/F021 lower left pencil is Unicode U+1F589 LOWER LEFT PENCIL; and covered in "Symbola" or "Segoe UI Symbol" as examples.

=-ref-=
[1] https://unicode.org/L2/L2011/11052r-wingding.pdf
Comment 10 V Stuart Foote 2024-01-03 20:13:23 UTC
(In reply to V Stuart Foote from comment #9)
 
> =-ref-=
> [1] https://unicode.org/L2/L2011/11052r-wingding.pdf

sorry here is the better ref, wef Unicode 7.0:

https://www.unicode.org/L2/L2012/12368-n4384.pdf
Comment 11 Stéphane Guillou (stragu) 2024-01-03 20:47:30 UTC
Created attachment 191738 [details]
results of comment 8 steps, with unicode-compliant fonts

(In reply to V Stuart Foote from comment #9)
> That is actually expected.
> 
> Unfortunately decimal 61473 or hex U+F021 is a glyph from the fonts Private
> Use Area -- no *reliable* font fall back can occur. In Wingding it is a left
> downward pencil, in Webdings it is a spider, in Symbol it is an exclamation
> mark. 
> 
> Dingbat glyphs from Winding or Webdings have mostly been mapped out to
> Unicode. [1] so should not be needed or used in preparing documents.
And that's also the point I make in comment 6. I only used the dingbat example to make the issue easier to see, but we could also show the problem with a pair of unicode-compliant fonts, for example using Benjamin first and then trying to insert that same recent character in a Liberation Serif paragraph, using the same steps as in comment 8. (See result in attached screenshot)
A user might like to use such a stylised "A" as a symbol for whatever reason, and using the dialog makes it look like that's indeed what will be inserted. But you end up with the Liberation Serif "A" instead.

I just noticed something that adds to the inconsistency: the toolbar dropdown differs in behaviour when compared to the dialog.
At step 3, try instead to use the Recent list in the toolbar dropdown. You'll see that the Benjamin "A" is indeed inserted.

So to me, there are clearly two issues to solve:

A) Using the dialog, the Recent/Favourite lists and the large Preview show a glyph that doesn't match what will be insterted
B) Using the toolbar dropdown Recent/Favourite lists has a different result to using the dialog's Recent/Favourite lists.

(tested using 7.6.4)
Comment 12 Heiko Tietze 2024-01-04 13:12:07 UTC
(In reply to Stéphane Guillou (stragu) from comment #11)
> I just noticed something that adds to the inconsistency: the toolbar
> dropdown differs in behaviour when compared to the dialog.
> At step 3, try instead to use the Recent list in the toolbar dropdown.
> You'll see that the Benjamin "A" is indeed inserted.
I was using the dialog only in comment 7.

My summary would be a bit different: 
* toolbar widget and dialog should behave the same
* one should expect the symbol that has been defined including the font
* the alternative scenario where eg. Greek symbols are used but no DF should be assigned is valid too and I suggest to add a checkbox "[x] Apply font settings" to the dialog (which would be considered in the widget as well).
Comment 13 Stéphane Guillou (stragu) 2024-01-04 14:26:17 UTC
(In reply to Heiko Tietze from comment #12)
> My summary would be a bit different: 
> * toolbar widget and dialog should behave the same
> * one should expect the symbol that has been defined including the font
> * the alternative scenario where eg. Greek symbols are used but no DF should
> be assigned is valid too and I suggest to add a checkbox "[x] Apply font
> settings" to the dialog (which would be considered in the widget as well).
Agree with this summary. I think the current behaviour of the dropdown is the correct one: font is remembered in the recent/favourite lists. (And this should be the default if the extra checkbox is added, but this can be discussed in bug 155274.)

(Once this is fixed, a follow-up ticket can be opened about what needs to happen to characters written after the inserted character. Currently, if inserted from the dropdown, the following characters will use the inserted character's font but I think the paragraph's font (or whatever was used as direct formatting before inserting the special character) should be kept. I.e. same behaviour as e.g. when a footnote anchor is inserted.)
Comment 14 Gabor Kelemen (allotropia) 2024-02-16 10:13:33 UTC
I think this was solved with

https://git.libreoffice.org/core/commit/cbcf22eb8748d59857b29a8792377a10fc6c42b2

tdf#159572 select font according to recent settings

It will be available in 24.8.0.
Comment 15 Stéphane Guillou (stragu) 2024-02-28 12:00:23 UTC
Indeed, thanks for the heads up, Gabor! It is now consistent between dialog and dropdown, the corresponding font is used, matching the listed glyph and not affecting the surrounding character in the paragraph. Great! :)

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a1a1d8edb9d4a62b747aa7069b3026e2ba75704d
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded