Custom Typeface bug in JUCE pop-up dialogs


#1

This seems to be similar to previous issue I have seen (Weird behaviour with in-memory fonts and OSX Layouts) but I am trying to move from JUCE 4.2.1 to JUCE 5.3.1 and I am getting off-by-one characters in the test of popup boxes.

How to reproduce:

  • Open DialogsDemo
  • Add roboto ttf to the project (so it goes in BinaryData)
  • Add a look and feel class
class LnF : public LookAndFeel_V4
{
public:
    LnF()
    {
        roboto = Typeface::createSystemTypefaceFor(BinaryData::fonts__roboto_ttf, BinaryData::fonts__roboto_ttfSize);
        setDefaultSansSerifTypeface(roboto);
    }

private:
     Typeface::Ptr roboto;
} feel;
  • Set look and feel as default
    Desktop::getInstance().setDefaultLookAndFeel(&feel);

  • Open App and make JUCE style (not system style) popups.

You will notice that the characters are a mess and they seem to be off by one character.

e.g.


#2

This bug was already reported in Bug with Alert Window text and embedded fonts in 5.3.1, but unfortunately it doesn’t seem there is a fix yet…


#3

@harrycodex could you try reverting commit 2e0f6b5dbccde550c4f9b9ed85f04009b61789b8 in JUCE and see if that fixes the issue? I unfortunately don’t have a Mac at hand to try that now…


#4

I have just tried on my Macbook and I cannot reproduce it. I will try on the Mac Pro when I get into the office in the morning. Weird. Both machines are 10.13.4 with latest release XCode and SDK


Bug with Alert Window text and embedded fonts in 5.3.1
#5

Thanks for the bug report. Reverting commit 2e0f6b5dbccde550c4f9b9ed85f04009b61789b8 does indeed fix the bug. We’ll get this sorted…


#6

OK. This is fixed on develop with commit f639b7b. This will appear on the public repo in a few minutes.