CustomTypeface and multithreads

Hi,

I have a strange bug… When using my own l&f in which I have CustomTypeface manager called by LookAndFeel::getTypefaceForFont(), strings rendered in progress dialog of a ThreadWithProgressDialog are unreadable.
I that normal and how can I fix this ?

Best regards

if I recall correctly, the GlyphCache is not thread safe.

Does this have anything to do with the issue I posted here.

I think AlertWindows use the AttributedString text method which are affected by this.

The dialog is always drawn on the event thread, so it’s not that.

Yeah I’ve seen that.
But what said dave96 is true.
Apparently, there is some issue with using CustomTypeface with TextLayout.
And indeed, I am seeing these errors with AlertWindow and tooltips which are both drawn using TextLayout.

[quote=“nicolas”]Hi,

I have a strange bug… When using my own l&f in which I have CustomTypeface manager called by LookAndFeel::getTypefaceForFont(), strings rendered in progress dialog of a ThreadWithProgressDialog are unreadable.
I that normal and how can I fix this ?

Best regards[/quote]

Yes, I’ve seen something similar with an AlertWindow. It was displaying the wrong characters for the message, but the title was OK. I was supplying a CustomTypeface font using getAlertWindowMessageFont().

I was short of time so avoided the issue by reverting to the default sans typeface. I was also too lazy to report the issue - sorry about that!

[quote=“Andrew J”][quote=“nicolas”]Hi,

I have a strange bug… When using my own l&f in which I have CustomTypeface manager called by LookAndFeel::getTypefaceForFont(), strings rendered in progress dialog of a ThreadWithProgressDialog are unreadable.
I that normal and how can I fix this ?

Best regards[/quote]

Yes, I’ve seen something similar with an AlertWindow. It was displaying the wrong characters for the message, but the title was OK. I was supplying a CustomTypeface font using getAlertWindowMessageFont().

I was short of time so avoided the issue by reverting to the default sans typeface. I was also too lazy to report the issue - sorry about that![/quote]

Apparently, It may be not so simple because TextLayout is locked to System fonts (I said, apparently).
Jules, is there a way to specify custom typefaces which will be well formed in those cases ?

I should add that I hadn’t changed the default sans in my custom LnF, so it was using the platform default. I think.

[quote]Apparently, It may be not so simple because TextLayout is locked to System fonts (I said, apparently).
Jules, is there a way to specify custom typefaces which will be well formed in those cases ?[/quote]

Ah yes… Well, you can disable the extended layout stuff using the JUCE_USE_DIRECTWRITE flag.