[Bug] Problems with Font ligatures in ComboBox/PopupMenu, but not in TextEditor

JUCE 7.0.5 unmodified, MacOS Mojave. Did not test on Windows.

I am using a custom third-party font. When you use a less than or greater than symbol < > with a dash -, it automatically turns it into a left or right arrow symbol - through ligatures. This then screws up my popup menus and causes other characters in the names to disappear.

The question is: why does the TextEditor display the text correctly, but the ComboBox (Label/Popup) does not? They are both using the same custom Font. This seems to imply that, rather than the problem being in the Font, that in fact JUCE could be handling the text for the ComboBox as it is doing for the TextEditor, thereby eliminating this “bug” and having a consistent behavior.

There was a previous thread that mentioned this issue, but went after a fix with the Font itself.

But my point is: why does the TextEditor display the same exact text with the custom Font correctly, but the ComboBox and PopupMenu do not?

This very simple test project (with embedded font) demonstrates the issue:

PopupTextTest.zip (146.8 KB)

Here we have a ComboBox, and underneath it a TextEditor. They both display the same exact text. Choosing the items from the ComboBox puts the text into the TextEditor.

You can turn off the checkbox to go back to the default Font, where everything then works normally without turning them into arrows (since that font doesn’t have the ligatures for it).

The text in the ComboBox is:

    juce::StringArray menuList = {
        "0 <--> 127 [32] Med Slow",
        "Another <- Item -> With Ligatures",
        "A Normal Item"

The ComboBox loses characters, while the TextEditor displays it correctly:

Here is the drop down menu:

Here is the second ComboBox item:

Here it is with the Custom Font turned off, back to the default Font:

I tried finding out what was different between TextEditor’s handling of Glyphs vs. ComboBox/PopupMenu (Label) but it’s too deep for me. :slight_smile:

1 Like