Bug 123527 - Insert / special Character not correctly rebuilding font chart to match selected font and search string
Summary: Insert / special Character not correctly rebuilding font chart to match selec...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.0.3 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.2.0 target:24.8.1
Keywords:
Depends on:
Blocks: Special-Character
  Show dependency treegraph
 
Reported: 2019-02-17 16:00 UTC by Luuk
Modified: 2024-08-21 10:30 UTC (History)
4 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 Luuk 2019-02-17 16:00:24 UTC
For some reason the order of input is affection the output of the display.

My default setting is font 'Liberation Serif'

[OPTION A]
If I check
- Insert/Special Character
- Type in field 'search': question
- Select font 'Marlett'
After this I do see 3 options.

[OPTION B]
If I check
- Insert/Special Character
- Select font 'Marlett'
- Type in field 'search': question
After this I do see 0 options.


This does not seem to be correct.

Other question to this subject:
- What kind of character am I inserting when following Option-A? The appearance of the question mark changes after the font is being changed!
Comment 1 V Stuart Foote 2019-02-17 19:18:19 UTC
Less an issue with the order in GUI, and more to do with a symbol font like Marlett. Symbol fonts receive the SYMBOL_CHARSET mapping of their PUA onto the lower 254 characters of ASCII 

A symbol font like Marlett will rarely if ever have its PUA mapped onto the Unicode system codepoint names, meaning the Search function in our Special Symbol dialog will find nothing.

But, there is a LibreOffice issue in populating the character map. When the font does not have coverage of UCS name string (i.e. no matching glyphs in the font) the chart should show nothing. Instead it is receiving some weird hybrid chart.

For example...search for "combi" for alll COMBINING form UCS, and select U+338 for "COMBINING LONG SOLIDUS OVERLAY".

Change from from default Liberation Serif to Liberation Sans Narrow (that has no coverage of U+338). We get the correct glyph preview with a "Missing character" label. But we also get an incorrect chart of glyphs--there are no combining characters in Liberation Sans Narrow, so the chart *should* be empty.

And in another glitch, again selecting Liberation Serif font from the drop list, will show the correct glyph from the font--but the font chart is *empty*. As if the chart is not being recalculated on font change.
Comment 2 Luuk 2019-02-19 07:49:58 UTC
Thanks for the explanation, and rephrasing, of this problem. 
Hopefully someone can correct this.
Comment 3 QA Administrators 2021-02-19 04:22:38 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2023-03-16 03:28:29 UTC Comment hidden (obsolete)
Comment 5 Dieter 2023-03-19 18:02:03 UTC
Still present in

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b5c3a7502f7ff6ccf0f829c1f3a2ba50b8584c41
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (de_DE); UI: en-GB
Calc: CL threaded
Comment 6 Luuk 2024-08-03 14:59:07 UTC
Still present in:
Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 12; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: threaded
Comment 7 Luuk 2024-08-03 15:01:50 UTC
(In reply to Luuk from comment #6)
> Still present in:
> Version: 24.2.1.2 (X86_64) / LibreOffice Community
> Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
> CPU threads: 12; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL:
> win
> Locale: nl-NL (nl_NL); UI: en-US
> Calc: threaded

(the 'Insert / Special Character' showing wrong characters is still present, my second question is answered already...)
Comment 8 V Stuart Foote 2024-08-03 17:08:07 UTC
(In reply to Luuk from comment #7)
> (In reply to Luuk from comment #6)
> > Still present in:
> > Version: 24.2.1.2 (X86_64) / LibreOffice Community
> > Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
> > CPU threads: 12; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL:
> > win
> > Locale: nl-NL (nl_NL); UI: en-US
> > Calc: threaded
> 
> (the 'Insert / Special Character' showing wrong characters is still present,
> my second question is answered already...)

I find that if I do a second font selection from the drop list (or close/reopen the SCD) the charmap refreshes with the desired font.  

It should change/redraw the charmap on first change of font.

But it seems to hold any valid found glyph from prior font selection--then releases it on a second font selection.

Can see the utility in the UI of keeping prior found glyph queued--to show the same glyph with a font change.  But shouldn't require a second font selection when the new font selected does not cover the prior glyph.

Easy (consistent) to work around but maybe need additional logic when font selected does not cover a prior covered code point. E.g. change from Liberation Sans --> Liberation Sans Narrow; or Liberation Serif --> Marlett

@Mike, Samuel -- think this was Akshay Deep's GSOC 2017 work on the search for the SCD. https://gerrit.libreoffice.org/c/core/+/40563 any cycles to have a look?
Comment 9 V Stuart Foote 2024-08-03 17:12:19 UTC
(In reply to V Stuart Foote from comment #8)
previous issue of a "odd" charmap result on font change has been resolved, e.g. Marlett returns an empty charmap for any search. Or Liberation Sans Narrow chart is empty of combining chars with "combi" but "com" does return UCS names with COMMA.
Comment 10 Mike Kaganski 2024-08-03 19:04:57 UTC
https://gerrit.libreoffice.org/c/core/+/171446
Comment 11 Commit Notification 2024-08-03 20:45:08 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/055c906d7b3f2e3709292d1410358d4e66a500ed

tdf#123527: use the new font in SvxSearchCharSet::RecalculateFont

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 V Stuart Foote 2024-08-04 06:09:59 UTC
Verified the font handling in SCD is now more responsive. Changing font (of a Paragraph in use) or in the SCD directly now rebuilds the charmap results and any search results against UCS name on first go.

=-testing-=
2024-08-04 TB77 nightly

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 055c906d7b3f2e3709292d1410358d4e66a500ed
CPU threads: 8; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 13 Commit Notification 2024-08-21 10:30:06 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

tdf#123527: use the new font in SvxSearchCharSet::RecalculateFont

It will be available in 24.8.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.