diff --git a/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp b/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp index 02d9612f60..0124a3b680 100644 --- a/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp +++ b/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp @@ -1495,9 +1495,18 @@ struct SimpleShapedTextTests : public UnitTest void runTest (const char* text, float maxWidth) { + const auto defaultTypeface = Font::getDefaultTypefaceForFont (FontOptions{}); + + if (defaultTypeface == nullptr) + { + DBG ("Skipping test: No default typeface found!"); + return; + } + String testString { text }; - SimpleShapedText st { &testString, ShapedTextOptions{}.withMaxWidth (maxWidth) }; + SimpleShapedText st { &testString, ShapedTextOptions{}.withFont (FontOptions { defaultTypeface }) + .withMaxWidth (maxWidth) }; auto success = true;