1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

SimpleShapedText: Prevent running tests when no default typefaces can be found

This commit is contained in:
Anthony Nicholls 2024-12-18 15:54:48 +00:00
parent 7a1f397de6
commit ad3457434e

View file

@ -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;