CustomTypeface and multithreads


#1

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


#2

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


#3

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.


#4

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


#5

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.


#6

[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!


#7

[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 ?


#8

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


#9

[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.