Bug 56363 - Using font features, the Special Character dialog opens with incorrect font on the charmap (now affecting OpenType in addition to Graphite smart fonts)
Summary: Using font features, the Special Character dialog opens with incorrect font o...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6.2.2 release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevEval
: 90269 (view as bug list)
Depends on:
Blocks: Special-Character
  Show dependency treegraph
 
Reported: 2012-10-24 18:34 UTC by Linus Drumbler
Modified: 2020-08-18 09:26 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Example of the bug (34.13 KB, image/png)
2013-07-01 17:01 UTC, Linus Drumbler
Details
Still present 4.4.1 (37.35 KB, image/png)
2015-04-01 18:11 UTC, Linus Drumbler
Details
Example with OpenType font (84.74 KB, application/vnd.oasis.opendocument.text)
2018-03-16 09:38 UTC, RGB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Linus Drumbler 2012-10-24 18:34:52 UTC
Truly, a trivial bug. I am using a Graphite-enabled font, and when I go to Insert Special Characters the font isn't the one I am using, but Segoe UI. I haven't tried uninstalling that font yet, but I doubt it will work.
Comment 1 Linus Drumbler 2012-10-24 22:41:44 UTC
This also happens when a saved file contains a font not installed on the used system.
Comment 2 Thomas Hackert 2013-07-01 15:07:16 UTC
Hello Linus, *,
I cannot confirm your bug with Version: 4.1.0.1 Build ID: 1b3956717a60d6ac35b133d7b0a0f5eb55e9155 under Debian Testing AMD64 ... :( Have you tested it with a newer version of LO than 3.6.2.2? Does it occur there as well? Which graphite font did you use? I have used Gentium Basic without any problem ... ;)
Sorry for the inconvenience
Thomas.
Comment 3 Linus Drumbler 2013-07-01 17:01:11 UTC
Created attachment 81825 [details]
Example of the bug

Charis SIL:1032=1 changes special characters dialog to UI font
Comment 4 Linus Drumbler 2013-07-01 17:02:17 UTC
The font I am using is Charis SIL Compact, and this bug is still present in LibreOffice 4.0.1.2 (the version I am using). Just to be clear: to reproduce, set a font to use a graphite feature and open the special characters dialog to find that the UI font is there instead.
Comment 5 Linus Drumbler 2013-07-01 17:03:04 UTC
Also, thank you for taking the time to test this. I got my Bugzilla account to report this bug, and it's finally getting noticed six months later.
Comment 6 Thomas Hackert 2013-07-03 16:56:29 UTC
Hello Linus, *,
(In reply to comment #4)
> The font I am using is Charis SIL Compact, and this bug is still present in
> LibreOffice 4.0.1.2 (the version I am using).

and you haven't tried a newer version of LO than 4.0.1.2 like 4.0.4.1 or 4.1.0.1 (RC)? Maybe it is fixed there ... ;)

> Just to be clear: to reproduce, set a font to use a graphite feature

Where (and how) have you set the font "to use a graphite feature"?
Sorry for the inconvenience
Thomas.
Comment 7 Linus Drumbler 2013-07-03 19:50:32 UTC
I won't get into the details, but download Charis SIL Compact (you can find it with you favourite search engine), switch to it as the typeface, and type in the font menu AFTER the font name "Charis SIL Compact": :1032=1. The font name should now read "Charis SIL Compact:1032=1".
Comment 8 QA Administrators 2015-04-01 14:42:14 UTC Comment hidden (obsolete)
Comment 9 Linus Drumbler 2015-04-01 18:11:24 UTC
Created attachment 114532 [details]
Still present 4.4.1

This bug is still reproducible on 4.4.1. Steps to reproduce:

1. Download and install a Graphite-enabled font
2. Activate a graphite feature in it
3. Insert → Special Character

Expected behaviour: the font displayed in Special Character is the font currently being used.

Actual behaviour: the font displayed in Special Character is the font used for the system user interface.
Comment 10 tommy27 2016-04-16 07:25:04 UTC Comment hidden (obsolete)
Comment 11 Linus Drumbler 2016-06-01 01:40:06 UTC
This bug is still present on 5.1.3.2, Ubuntu 14.04. I'm too lazy to take a screenshot this time. Just please take a look at it.
Comment 12 Pierre C 2016-08-14 13:02:14 UTC
bug 90269 is a duplicate of this bug
https://bugs.documentfoundation.org/show_bug.cgi?id=90269
so closing the 90296 bug.
This bug seems really easy to solve, can't it be an easyhack ?
Comment 13 Pierre C 2016-08-14 13:03:33 UTC
*** Bug 90269 has been marked as a duplicate of this bug. ***
Comment 14 jani 2016-08-30 06:53:37 UTC
For this to be a easyHack, you need to fill in the keywords:
skill<foo>
difficulty<foo>
topic<foo>
As well as add a code pointer.

This is normally done by a core developer, but since you have added "easyHack" then I assume you know that.

Putting the bug on NEEDINFO until the above is resolved.
Comment 15 Xisco Faulí 2016-09-27 10:36:18 UTC Comment hidden (obsolete)
Comment 16 EricP 2017-02-10 05:05:53 UTC
I can confirm that this bug still exists in LO 5.3 on Windows.

The bug is "trivial" in that the workaround is trivial. 

Normally the Special Characters dialog preselects the current font at the cursor location in the drop down list. However, when the document cursor is within a font with an enabled font feature, then the font at the cursor is NOT preselected, and Segoe UI is selected instead (on Windows 7).

Explanation of font features: http://software.sil.org/charis/wp-content/uploads/sites/14/2015/11/CharisSIL-features5.000.pdf
Comment 17 RGB 2018-03-16 09:38:14 UTC
Created attachment 140663 [details]
Example with OpenType font

This also happens with OpenType fonts. On the attached document there are two paragraph styles, style1 and style2, both using Libertinus Serif font, but the second paragraph style add the "onum" (old style numerals) OpenType tag. The result when you click on "insert special character" is shown on the screenshots: on the first paragraph (using style1 and hence "Libertinus Serif") the insert special character dialogue offers the right font, but on the second paragraph (using style2 and hence "Libertinus Serif:onum") offers a different font.
Comment 18 russell 2018-08-10 06:11:25 UTC
I tried the attachment document, "Example with OpenType font", 
SpecialCharTest.odt (3rd in the list).

The Font Name drop-down is Libertinus Serif, and is Italic.
I know this means the font is being substituted.

If I go to Insert > Special Character. 

In 6.0.6.2, the Font drop-down was Bitstream Vera Sans. 
In 6.1.0.3, the Font drop-down is empty.
Comment 19 Heiko Tietze 2020-08-16 08:21:20 UTC
Special character dialog has been reworked completely. Chosen font is applied to what goes into the document.
Comment 20 RGB 2020-08-16 08:46:42 UTC
(In reply to Heiko Tietze from comment #19)
> Special character dialog has been reworked completely. Chosen font is
> applied to what goes into the document.

In which version? For me, it doesn't work with 7.0. Steps to reproduce:

1) Set your text in Libertinus Serif.
2) Select a couple of words and set the font as follows:
      Libertinus Serif:smcp
   Selected text turns into small caps. (You can use any other OpenType tag)
3) With the cursor inside that text, open the Insert Character dialog

Result: the font box in the dialog is empty and a generic sans font is shown instead.
Comment 21 V Stuart Foote 2020-08-16 16:17:49 UTC
Yes confirming issue now affects both Graphite and OT font use on Windows alike.
Removing the easyHack as no code pointers. Have not checked if Linux builds are likewise affected.

Version: 7.1.0.0.alpha0+ (x64)
Build ID: <buildversion>
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

2020-08-15 TB77 daily for master
buildid=4708fa80ac95f11bfbfd422bec52865a17b46fd9

Setting additional font feature (from Paragraph style or Character DF) is sufficient to confuse the Special Character Dialog. On launching the dialog an incorrect font populates the charmap, and any glyph selected is applied to document in that incorrect font.

So, seems an issue in resolving font name with an appended smart font notation (either Harfbuzz or Graphite handling).

@Tomaž -- is there a way to make use of your font/FeatureParser work on bug 58941 to at least pass a corrected/truncated font name to the charmap Special Character dialog? Or, the much more ambitious effort to render (and pick from) the charmap with the font feature(s) applied?
Comment 22 Tomaz Vajngerl 2020-08-18 09:26:37 UTC
Well looks like that the special character dialog doesn't take into account the font features and actually when the font has features applied, it just can't find the font and sets an empty string. Truncating away the font features from the name could be a quick fix yes and FeatureParser should be able to do that, but to properly implement this, the special character dialog must take font features into account.