1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fix assertion during Font fallback

Since 4122427748 assertions are guarding
the FontOptions::withName, withStyle and withTypeface member functions.

Since then the only way to replace an existing typeface without hitting
these assertions is to clear all three fields before calling
withTypeface, which then sets all three values. It is always legal to
just clear an existing Typeface and rely on the name and style fields.
This commit is contained in:
attila 2024-06-13 17:37:08 +02:00 committed by Attila Szarvas
parent df45c4ae9f
commit 4828bd886d

View file

@ -275,6 +275,9 @@ public:
jassert (getReferenceCount() == 1);
typeface = newTypeface;
if (typeface != nullptr)
options = options.withTypeface (nullptr).withName ("").withStyle ("");
options = options.withTypeface (typeface);
}